[Webkit-unassigned] [Bug 142382] New: __proto__ shorthand property should not modify prototype in Object Literal construction
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Mar 5 20:29:14 PST 2015
https://bugs.webkit.org/show_bug.cgi?id=142382
Bug ID: 142382
Summary: __proto__ shorthand property should not modify
prototype in Object Literal construction
Classification: Unclassified
Product: WebKit
Version: 528+ (Nightly build)
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: JavaScriptCore
Assignee: webkit-unassigned at lists.webkit.org
Reporter: joepeck at webkit.org
CC: ggaren at apple.com, rniwa at webkit.org
* SUMMARY
__proto__ shorthand property should not modify prototype in Object Literal construction.
<https://kangax.github.io/compat-table/es6/> has a section that __proto__ should not be supported as a shorthand, citing:
"Annex b ยง __proto__ in object literals".
{__proto__} should not be equivalent to {__proto__:...}.
Seems to be because:
PropertyDefinition : IdentifierReference
...
7. Return CreateDataPropertyOrThrow(object, propName, propValue).
And that does not fall under the Annex's special case handling of __proto__ in literals for grammar rule:
PropertyDefinition : PropertyName : AssignmentExpression
So we shouldn't get the special handling.
--
Seems the expected behavior of __proto__ as a shorthand would be the equivalent of a Object.defineProperty(obj, "__proto__", { value: ... }) which sets the property but doesn't change the prototype.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150306/b7e3b4d9/attachment-0002.html>
More information about the webkit-unassigned
mailing list