Skip to content

Commit 10fef15

Browse files
committed
fix: Remove Object.defineProperty calls causing conflicts
- Properties are already enumerable by default - Keep JSDoc comments in header for documentation - Fixes TypeError: Cannot set property maps
1 parent ef1b4f7 commit 10fef15

1 file changed

Lines changed: 0 additions & 42 deletions

File tree

phantom.js

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -423,48 +423,6 @@
423423
return "Phantom.js v" + phantom.version + " - Use phantom._() or phantom.help() for help";
424424
};
425425

426-
// Add enumerable properties for better autocomplete discovery in OIE
427-
// This helps editors show available options when typing "phantom."
428-
try {
429-
Object.defineProperty(phantom, 'maps', {
430-
enumerable: true,
431-
configurable: true,
432-
get: function() { return phantom.maps; }
433-
});
434-
Object.defineProperty(phantom, 'strings', {
435-
enumerable: true,
436-
configurable: true,
437-
get: function() { return phantom.strings; }
438-
});
439-
Object.defineProperty(phantom, 'numbers', {
440-
enumerable: true,
441-
configurable: true,
442-
get: function() { return phantom.numbers; }
443-
});
444-
Object.defineProperty(phantom, 'json', {
445-
enumerable: true,
446-
configurable: true,
447-
get: function() { return phantom.json; }
448-
});
449-
Object.defineProperty(phantom, 'base64', {
450-
enumerable: true,
451-
configurable: true,
452-
get: function() { return phantom.base64; }
453-
});
454-
Object.defineProperty(phantom, 'xml', {
455-
enumerable: true,
456-
configurable: true,
457-
get: function() { return phantom.xml; }
458-
});
459-
Object.defineProperty(phantom, 'dates', {
460-
enumerable: true,
461-
configurable: true,
462-
get: function() { return phantom.dates; }
463-
});
464-
} catch (e) {
465-
// If defineProperty fails, properties are already set normally
466-
}
467-
468426
// Only log on error (as requested)
469427
function logError(msg) {
470428
if (typeof logger !== "undefined") {

0 commit comments

Comments
 (0)