Early error on ANY operator before new.target
authorcaitp@igalia.com <caitp@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Aug 2017 21:34:20 +0000 (21:34 +0000)
committercaitp@igalia.com <caitp@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Aug 2017 21:34:20 +0000 (21:34 +0000)
commitd369aa37c8c30b3ea909c8ea8cd46462f628931e
treed2d972707214b995f76fdd9129a21e9cb01cdcdc
parentfc017df34fa0b6de84ffef2261766be07cd80bfe
Early error on ANY operator before new.target
https://bugs.webkit.org/show_bug.cgi?id=157970

Reviewed by Saam Barati.

Instead of throwing if any unary operator precedes new.target, only
throw if the unary operator updates the reference.

The following become legal in JSC:

```
!new.target
~new.target
typeof new.target
delete new.target
void new.target
```

All of which are legal in v8 and SpiderMonkey in strict and sloppy mode

JSTests:

* stress/new-target-syntax-errors.js:
* stress/new-target.js:

Source/JavaScriptCore:

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseUnaryExpression):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/default-value-parsing-should-propagate-error.js
JSTests/stress/new-target-syntax-errors.js
JSTests/stress/new-target.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/Parser.cpp