Closed Bug 201989 Opened 22 years ago Closed 22 years ago

prototype property of predefined error object is neither ReadOnly nor DontDelete

Categories

(Rhino Graveyard :: Core, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: igor, Assigned: norrisboyd)

Details

Attachments

(2 files, 1 obsolete file)

The EcmaScript standard in 15.11.7.6 states: 15.11.7.6 NativeError.prototype The initial value of NativeError.prototype is a NativeError prototype object (15.11.7.7). Each NativeError constructor has a separate prototype object. This property has the attributes { DontEnum, DontDelete, ReadOnly }. In Rhino the prototype property has neither of this attributes as a test case from the following attchment indicates.
Attached file Test case
The test case should print nothing, but instead it indicates failure for each error object. Note: the test case does not check that prototype is DontEnum
Igor, thank you for these tests! I added one for DontEnum, also. I split them up and added them to JS testsuite as follows: mozilla/js/tests/ecma_3/Exceptions/15.11.7.6-001.js <---DontEnum mozilla/js/tests/ecma_3/Exceptions/15.11.7.6-002.js <---DontDelete mozilla/js/tests/ecma_3/Exceptions/15.11.7.6-003.js <---ReadOnly All three are currently passing in SpiderMonkey. In Rhino, only the first one is passing -
Since the changes to NatveGlobal removed the only usage of IdFunction.setFunctionType method outside IdFunction, I extended the patch to remove setFunctionType and corresponding getFunctionType in IdFunction and use a simple private boolean field there to mark functions that can be called as constructors.
Attachment #120461 - Attachment is obsolete: true
I committed the above fix.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Verified FIXED. The above testcases now pass in the Rhino shell in compiled and interpreted mode.
Status: RESOLVED → VERIFIED
Targeting as resolved against 1.5R5
Target Milestone: --- → 1.5R5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: