[Webkit-unassigned] [Bug 190637] New: delete expression should not throw without a reference

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 16 13:42:04 PDT 2018


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

            Bug ID: 190637
           Summary: delete expression should not throw without a reference
           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: leo at bocoup.com

This test is wrong:

https://github.com/WebKit/webkit/blob/master/LayoutTests/js/script-tests/basic-strict-mode.js#L153

```
"use strict";
var a = { b: 42 };
delete void a.b;
```

The delete expression should not throw, but it throws a syntax error requiring a reference expression.

The specs says the expression should return true when the right hand expression is not a reference:

https://tc39.github.io/ecma262/#sec-delete-operator-runtime-semantics-evaluation

the void expression will normally return undefined and this value is not a reference.

This bug is only seen on JSC. Other major engines are showing the expected behavior.

```
eshost -x '"use strict"; var a = { b: 42 }; delete void a.b'
#### v8-harmony


#### v8


#### jsc
SyntaxError: The delete operator requires a reference expression.

#### spidermonkey


#### ch


#### node


```

The same happens if the expression is `delete void 0` or `delete typeof 0` but changing the expression from `delete (void 0)` gets the correct behavior.


I'm sending some tests to Test262 to support this and prevent it from other occurrences.

-- 
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/20181016/00ea4b8f/attachment.html>


More information about the webkit-unassigned mailing list