Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Unreviewed, rolling in the rest of r237254
https://bugs.webkit.org/show_bug.cgi?id=190340 JSTests: * ChakraCore/test/Function/FuncBodyES5.baseline-jsc: * stress/function-cache-with-parameters-end-position.js: Added. (shouldBe): (shouldThrow): (i.anonymous): * stress/function-constructor-name.js: Added. (shouldBe): (GeneratorFunction): (AsyncFunction.async): (AsyncGeneratorFunction.async): (anonymous): (async.anonymous): * test262/expectations.yaml: LayoutTests/imported/w3c: * web-platform-tests/html/webappapis/scripting/events/inline-event-handler-ordering-expected.txt: * web-platform-tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-late-expected.txt: * web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-in-attribute-expected.txt: * web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-in-body-onerror-expected.txt: Source/JavaScriptCore: * parser/ParserModes.h: * parser/ParserTokens.h: (JSC::JSTextPosition::JSTextPosition): (JSC::JSTokenLocation::JSTokenLocation): Deleted. * runtime/CodeCache.cpp: (JSC::CodeCache::getUnlinkedGlobalFunctionExecutable): * runtime/FunctionConstructor.cpp: (JSC::constructFunctionSkippingEvalEnabledCheck): LayoutTests: * fast/dom/attribute-event-listener-errors-expected.txt: * fast/events/attribute-listener-deletion-crash-expected.txt: * fast/events/window-onerror-syntax-error-in-attr-expected.txt: * js/dom/invalid-syntax-for-function-expected.txt: * js/dom/script-start-end-locations-expected.txt: Canonical link: https://commits.webkit.org/206541@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
197 additions
and 120 deletions.
- +7 −7 JSTests/ChakraCore/test/Function/FuncBodyES5.baseline-jsc
- +19 −0 JSTests/ChangeLog
- +40 −0 JSTests/stress/function-cache-with-parameters-end-position.js
- +36 −0 JSTests/stress/function-constructor-name.js
- +6 −6 JSTests/test262/expectations.yaml
- +11 −0 LayoutTests/ChangeLog
- +1 −1 LayoutTests/fast/dom/attribute-event-listener-errors-expected.txt
- +20 −20 LayoutTests/fast/events/attribute-listener-deletion-crash-expected.txt
- +3 −3 LayoutTests/fast/events/window-onerror-syntax-error-in-attr-expected.txt
- +10 −0 LayoutTests/imported/w3c/ChangeLog
- +1 −1 ...3c/web-platform-tests/html/webappapis/scripting/events/inline-event-handler-ordering-expected.txt
- +2 −2 ...-tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-late-expected.txt
- +1 −1 ...atform-tests/html/webappapis/scripting/processing-model-2/compile-error-in-attribute-expected.txt
- +1 −1 ...orm-tests/html/webappapis/scripting/processing-model-2/compile-error-in-body-onerror-expected.txt
- +1 −1 LayoutTests/js/dom/invalid-syntax-for-function-expected.txt
- +6 −6 LayoutTests/js/dom/script-start-end-locations-expected.txt
- +14 −0 Source/JavaScriptCore/ChangeLog
- +0 −1 Source/JavaScriptCore/parser/ParserModes.h
- +0 −8 Source/JavaScriptCore/parser/ParserTokens.h
- +2 −13 Source/JavaScriptCore/runtime/CodeCache.cpp
- +16 −49 Source/JavaScriptCore/runtime/FunctionConstructor.cpp
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,40 @@ | ||
function shouldBe(actual, expected) { | ||
if (actual !== expected) | ||
throw new Error('bad value: ' + actual); | ||
} | ||
|
||
function shouldThrow(func, errorMessage) { | ||
var errorThrown = false; | ||
var error = null; | ||
try { | ||
func(); | ||
} catch (e) { | ||
errorThrown = true; | ||
error = e; | ||
} | ||
if (!errorThrown) | ||
throw new Error('not thrown'); | ||
if (String(error) !== errorMessage) | ||
throw new Error(`bad error: ${String(error)}`); | ||
} | ||
|
||
for (var i = 0; i < 10; ++i) { | ||
var f = Function('/*) {\n*/', 'return 42'); | ||
shouldBe(f.toString(), | ||
`function anonymous(/*) { | ||
*/) { | ||
return 42 | ||
}`); | ||
} | ||
shouldThrow(() => Function('/*', '*/){\nreturn 42'), `SyntaxError: Parameters should match arguments offered as parameters in Function constructor.`); | ||
|
||
shouldThrow(() => Function('/*', '*/){\nreturn 43'), `SyntaxError: Parameters should match arguments offered as parameters in Function constructor.`); | ||
for (var i = 0; i < 10; ++i) { | ||
var f = Function('/*) {\n*/', 'return 43'); | ||
shouldBe(f.toString(), | ||
`function anonymous(/*) { | ||
*/) { | ||
return 43 | ||
}`); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,36 @@ | ||
function shouldBe(actual, expected) { | ||
if (actual !== expected) | ||
throw new Error('bad value: ' + actual); | ||
} | ||
|
||
var GeneratorFunction = function*(){}.constructor; | ||
var AsyncFunction = async function(){}.constructor; | ||
var AsyncGeneratorFunction = async function*(){}.constructor; | ||
|
||
var f = Function(`return 42`); | ||
shouldBe(typeof anonymous, `undefined`); | ||
shouldBe(f.toString(), | ||
`function anonymous() { | ||
return 42 | ||
}`); | ||
|
||
var gf = GeneratorFunction(`return 42`); | ||
shouldBe(typeof anonymous, `undefined`); | ||
shouldBe(gf.toString(), | ||
`function* anonymous() { | ||
return 42 | ||
}`); | ||
|
||
var af = AsyncFunction(`return 42`); | ||
shouldBe(typeof anonymous, `undefined`); | ||
shouldBe(af.toString(), | ||
`async function anonymous() { | ||
return 42 | ||
}`); | ||
|
||
var agf = AsyncGeneratorFunction(`return 42`); | ||
shouldBe(typeof anonymous, `undefined`); | ||
shouldBe(agf.toString(), | ||
`async function* anonymous() { | ||
return 42 | ||
}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,4 +1,4 @@ | ||
CONSOLE MESSAGE: line 4: ReferenceError: Can't find variable: error | ||
CONSOLE MESSAGE: line 5: SyntaxError: Invalid character: '@' | ||
This test verifies that an attribute event listener error shows the right line number even if the attribute contains newlines. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,21 +1,21 @@ | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '|' | ||
PASS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,6 +1,6 @@ | ||
Test that window.onerror is called on window object when there is a syntax error in attribute handler. Bug 70991. | ||
|
||
Main frame window.onerror: SyntaxError: Unexpected token '%' at window-onerror-syntax-error-in-attr.html:10:38 SyntaxError: Unexpected token '%' | ||
Main frame window.onerror: SyntaxError: Unexpected token '%' at window-onerror-syntax-error-in-attr.html:36:38 SyntaxError: Unexpected token '%' | ||
Main frame window.onerror: SyntaxError: Unexpected token '%' at window-onerror-syntax-error-in-attr.html:36:14 SyntaxError: Unexpected token '%' | ||
Button 1 Button 2 Button 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,5 +1,5 @@ | ||
CONSOLE MESSAGE: line 24: SyntaxError: Parser error | ||
CONSOLE MESSAGE: line 21: SyntaxError: Parser error | ||
|
||
FAIL Invalid uncompiled raw handlers should only be compiled when about to call them. assert_array_equals: lengths differ, expected 3 got 4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,4 +1,4 @@ | ||
CONSOLE MESSAGE: line 24: SyntaxError: Unexpected end of script | ||
|
||
PASS window.onerror - compile error in attribute | ||
PASS window.onerror - compile error in attribute (column) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,5 +1,5 @@ | ||
CONSOLE MESSAGE: line 19: SyntaxError: Unexpected token ')' | ||
CONSOLE MESSAGE: line 16: SyntaxError: Unexpected end of script | ||
|
||
PASS window.onerror - compile error in <body onerror> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,3 +1,3 @@ | ||
CONSOLE MESSAGE: line 1: SyntaxError: Invalid character: '#' | ||
This test ensures we don't crash when we are given garbage for an attribute expecting a function. | ||
https://bugs.webkit.org/show_bug.cgi?id=19025 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.