Closed Bug 588138 Opened 14 years ago Closed 9 years ago

Object.defineProperty() allows to overwrite frozen Object properties

Categories

(Core :: JavaScript Engine, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mario, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; Linux i686; rv:2.0b4pre) Gecko/20100816 Minefield/4.0b4pre
Build Identifier: 

Object.defineProperty() allows to overwrite frozen Object properties - which should not be possible. Example 

{{{
Object.defineProperty(window, 'alert', {value:prompt,configurable:false});
alert(1);
Object.defineProperty(window, 'alert', {value:confirm,configurable:false});
alert(1);
}}}

Reproducible: Always

Steps to Reproduce:
1. Execute the example code

Actual Results:  
the first alert(1) will execute prompt(1) - the second alert(1) will execute confirm(1)

Expected Results:  
Both alerts should execute prompt(1)
Tested on: Mozilla/5.0 (X11; Linux i686; rv:2.0b4pre) Gecko/20100816 Minefield/4.0b4pre
Status: UNCONFIRMED → NEW
Ever confirmed: true
This appears to be a browser-only.
Assignee: general → nobody
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.