Assertion failure for destructuring assignment with new.target and unary operator
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Apr 2016 20:05:13 +0000 (20:05 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Apr 2016 20:05:13 +0000 (20:05 +0000)
commitbd420938c0f1dccdcbaf202476285356732c9497
tree206edaaa524e18c6bc0e1a874bef7c8840623dc9
parenta66cca3ecbab6140e5dfa34de241b6d40993ccd3
Assertion failure for destructuring assignment with new.target and unary operator
https://bugs.webkit.org/show_bug.cgi?id=157149

Reviewed by Saam Barati.

The caller of parseDefaultValueForDestructuringPattern() should propagate errors.
And this patch also cleans up createSavePoint and createSavePointForError; introducing SavePointWithError.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseSourceElements):
(JSC::Parser<LexerType>::parseDestructuringPattern):
Add propagateErorr() for parseDefaultValueForDestructuringPattern.

(JSC::Parser<LexerType>::parseAssignmentExpression):
* parser/Parser.h:
(JSC::Parser::restoreLexerState):
(JSC::Parser::internalSaveState):
(JSC::Parser::createSavePointForError):
(JSC::Parser::createSavePoint):
(JSC::Parser::internalRestoreState):
(JSC::Parser::restoreSavePointWithError):
(JSC::Parser::restoreSavePoint):
* tests/stress/default-value-parsing-should-propagate-error.js: Added.
(testSyntaxError):
(testSyntaxError.f):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/Parser.cpp
Source/JavaScriptCore/parser/Parser.h
Source/JavaScriptCore/tests/stress/default-value-parsing-should-propagate-error.js [new file with mode: 0644]