Closed Bug 726106 Opened 12 years ago Closed 5 years ago

Object.defineProperty() on sealed standard objects throws NPE

Categories

(Rhino Graveyard :: Core, defect)

head
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INACTIVE

People

(Reporter: anba, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

Attached file JUnit test case to show the NPE (obsolete) —
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20100101 Firefox/10.0
Build ID: 20120129021758

Steps to reproduce:

Sealing the built-in objects with Context#initStandardObjects() by passing true as the second argument does not work with Object.defineProperty(). See the attached JUnit test case for an example using Boolean.prototype.

Note: "sealing" does not refer to Object.seal() in this case!


Actual results:

ScriptableObject#createSlot() throws a NullPointerException b/c ScriptableObject#slots is null


Expected results:

Most likely this should throw an instance of org.mozilla.javascript.EvaluatorException. Just like it's the case for setting any other property on Boolean.prototype if the standard objects are sealed, e.g. with a plain assignment "Boolean.prototype.x = 0".
Attachment #596122 - Attachment is obsolete: true

Closing. Bug management is now done here:
https://github.com/mozilla/rhino

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: