[Webkit-unassigned] [Bug 159398] [test262] Fixing mapped arguments object property test case
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Oct 12 10:58:29 PDT 2016
https://bugs.webkit.org/show_bug.cgi?id=159398
--- Comment #74 from Caio Lima <ticaiolima at gmail.com> ---
(In reply to comment #73)
> Comment on attachment 291051 [details]
> Patch
>
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=291051&action=review
>
> > Source/JavaScriptCore/runtime/GenericArgumentsInlines.h:194
> > + if (optionalIndex && !thisObject->isConfigurable(optionalIndex.value()) && !descriptor.justWritablePresent())
>
> I'm not sure this is correct here. I think you want to be following:
> https://tc39.github.io/ecma262/#sec-validateandapplypropertydescriptor
> more or less here, with some extra rules defined in:
> https://tc39.github.io/ecma262/#sec-arguments-exotic-objects-
> defineownproperty-p-desc
Yes. Actually, this patch is totally incorrect. I can reuse some code, but I need a totally different approach. The current Mapping is controlled by m_overrides. I think that finally I understood this mechanism. The idea is to override things as soon as we define a different descriptor from default and fallback operations like defineOwnProperty, getOwnProperty and delete to Base. The problem of this approach is that the ES6 mapping rules changed and this mechanism need to be fixed. I am with a new idea in mind that is separate fallBack operations to Base from mapping rules and I think it can work.
> It looks like the code below falls back to normal object storage. Why not
> just fall back to normal object storage in every case instead of creatina
> the isConfigurable map?
>
> > JSTests/stress/arguments-non-configurable.js:27
> > +function tryChangeWritableOfNonConfigurableDescriptor(x) {
> > + Object.defineProperty(arguments, 0, {configurable: false});
> > + Object.defineProperty(arguments, 0, {writable: true});
> > + Object.defineProperty(arguments, 0, {writable: false});
> > +}
>
> This is the specified behavior? This goes against normal object behavior:
>
> >>> Object.defineProperty(o, "f", {configurable: false, value: 20})
> [object Object]
> >>> o.f
> 20
> >>> o.f = 40
> 40
> >>> o.f
> 20
> >>> Object.defineProperty(o, "f", {writable: true, value:50})
> Exception: TypeError: Attempting to change writable attribute of
> unconfigurable property.
Also, this test case Is incorrect and I am going to remove it. I already created a test case validating spec behavior (https://tc39.github.io/ecma262/#sec-arguments-exotic-objects-defineownproperty-p-desc).
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20161012/9ad345ee/attachment.html>
More information about the webkit-unassigned
mailing list