Bug 66473 - preventExtensions failing to prevent deleted property bounce back
Summary: preventExtensions failing to prevent deleted property bounce back
Status: RESOLVED DUPLICATE of bug 61014
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 61014
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-18 08:48 PDT by Mark S. Miller
Modified: 2012-03-13 12:36 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark S. Miller 2011-08-18 08:48:33 PDT
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.
Comment 1 Gavin Barraclough 2011-08-18 14:59:05 PDT
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.
Comment 2 Mark S. Miller 2011-08-18 16:14:03 PDT
Hi Gavin,

In light of your comment, I'm recording that this bug Depends on 61014.
Comment 3 Gavin Barraclough 2012-03-13 12:36:16 PDT
This is fixed in ToT, most likely by r61014

*** This bug has been marked as a duplicate of bug 61014 ***