Bug 66473
Summary: | preventExtensions failing to prevent deleted property bounce back | ||
---|---|---|---|
Product: | WebKit | Reporter: | Mark S. Miller <erights> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | barraclough, erights, oliver |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | 61014 | ||
Bug Blocks: |
Mark S. Miller
On WebKit Nightly r93293:
> 'compile' in RegExp.prototype
true
> Object.preventExtensions(RegExp.prototype)
/(?:)/
> delete RegExp.prototype.compile
true
> 'compile' in RegExp.prototype
true
The fact that compile reappears is itself a spec violation. IIUC, at least it is intentional, as it is thought to be required to support some legacy behavior. (Note that this is unlikely to still be true, since RegExp.prototype.compile is deletable on other browsers.)
In any case, since the above delete operation returns 'true', we might try to explain this as triggering some other hidden agent that immediately adds it back in after it gets deleted. With that explanation in mind, If RegExp.prototype has already been made non-extensible, as above, then this attempt to add it back in should fail. As shown above, it doesn't.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Gavin Barraclough
I believe we currently consider the reappearance of the original property to be purely a bug, which should be fixed. (tracked by Bug 61014).
When this is fixed, I would expect this test to behave correctly - so I don't think there should be anything special to do here related to preventExtensions, we just need to find time to fix static property deletion.
I think this is a useful bug to keep open & track separately, since this is a worthwhile test case to validate that we do get this right once we have the underlying bug fixed to make sure this does then behave correctly.
Mark S. Miller
Hi Gavin,
In light of your comment, I'm recording that this bug Depends on 61014.
Gavin Barraclough
This is fixed in ToT, most likely by r61014
*** This bug has been marked as a duplicate of bug 61014 ***