Closed Bug 300534 Opened 19 years ago Closed 19 years ago

Internal Narcissus functions showing up in objects' prototypes

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mrbkap, Assigned: mrbkap)

Details

Attachments

(1 file)

There are a few functions that we use internally in the implementation that need
to be __defineProperty__'d to be non-enumerable.
Attachment #189114 - Flags: review?(brendan)
Status: NEW → ASSIGNED
Comment on attachment 189114 [details] [diff] [review]
Make the functions non-enumerable

>+Array.prototype.__defineProperty__('top', function () { 
>+        return this.length && this[this.length-1]; 
>+    }, false, false, true);

Looks great, only comment is to indent this the same way you indented the
earlier ones: one basic offset for the body statement, 0 for the closing brace
and trailing args to __defineProperty__.  Alternative:

Array.prototype.__defineProperty__('top',
    function () { 
	return this.length && this[this.length-1]; 
    },
    false, false, true);

or even:

Array.prototype.__defineProperty__(
    'top',
    function () { 
	return this.length && this[this.length-1]; 
    },
    false, false, true
);

/be
Attachment #189114 - Flags: review?(brendan) → review+
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Keywords: narcissus
Resolution: --- → FIXED
Summary: Narcissus: Internal Narcissus functions showing up in objects' prototypes → Internal Narcissus functions showing up in objects' prototypes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: