[Webkit-unassigned] [Bug 158116] New: Function#arguments and Function#caller break the invariability of nonconfigurable, nonwritable properties

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 26 05:09:24 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=158116

            Bug ID: 158116
           Summary: Function#arguments and Function#caller break the
                    invariability of nonconfigurable, nonwritable
                    properties
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: claude.pache at gmail.com

According to [ES6 6.7.1.3] Invariants of the Essential Internal Methods:


     If a property P is described as a data property with Desc.[[Value]] equal to v and Desc.[[Writable]] and Desc.[[Configurable]] are both false, then the SameValue must be returned for the Desc.[[Value]] attribute of the property on all future calls to [[GetOwnProperty]] ( P ).

[ES6 6.7.1.3]: http://www.ecma-international.org/ecma-262/6.0/#sec-invariants-of-the-essential-internal-methods


Testcase against `Function#arguments`

```js
function f() { return Object.getOwnPropertyDescriptor(f, 'arguments'); }
Object.getOwnPropertyDescriptor(f, 'arguments');
// value: null, writable: false, configurable: false
f();
// value: Arguments[], writable: false, configurable: false
```


Testcase against `Function#caller`

```js
function g() { return Object.getOwnPropertyDescriptor(g, 'caller'); }
function h() { return g(); }
Object.getOwnPropertyDescriptor(g, 'caller');
// value: null, writable: false, configurable: false
h();
// value: function h(), writable: false, configurable: false
```


Suggested fix: Use getters.


Similar bug: Bug 151348

-- 
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/20160526/44b11634/attachment-0001.html>


More information about the webkit-unassigned mailing list