mirror of
https://github.com/tc39/test262.git
synced 2025-07-27 07:54:41 +02:00
Fix tests for HTML comments in function body evaluation (#2109)
Ref tc39/ecma262#1479
This commit is contained in:
parent
8d3dd2d1a0
commit
5908ed29ac
@ -4,22 +4,19 @@
|
|||||||
/*---
|
/*---
|
||||||
esid: sec-createdynamicfunction
|
esid: sec-createdynamicfunction
|
||||||
description: >
|
description: >
|
||||||
Function parses the body text before forming the sourceText with the proper line feed.
|
Function body is wrapped with new lines before being parsed
|
||||||
info: |
|
info: |
|
||||||
The HTMLCloseComment requires a preceding line terminator.
|
The HTMLCloseComment requires a preceding line terminator.
|
||||||
|
|
||||||
Runtime Semantics: CreateDynamicFunction(constructor, newTarget, kind, args)
|
Runtime Semantics: CreateDynamicFunction(constructor, newTarget, kind, args)
|
||||||
...
|
...
|
||||||
16. Set bodyText to ? ToString(bodyText).
|
Set bodyText to ? ToString(bodyText).
|
||||||
17. Let parameters be the result of parsing P, interpreted as UTF-16 encoded Unicode text as
|
Let parameters be the result of parsing P, interpreted as UTF-16 encoded Unicode text as
|
||||||
described in 6.1.4, using parameterGoal as the goal symbol. Throw a SyntaxError exception if the
|
described in 6.1.4, using parameterGoal as the goal symbol. Throw a SyntaxError exception if the
|
||||||
parse fails.
|
parse fails.
|
||||||
18. Let body be the result of parsing bodyText, interpreted as UTF-16 encoded Unicode text as
|
Let body be the result of parsing bodyText, interpreted as UTF-16 encoded Unicode text as
|
||||||
described in 6.1.4, using goal as the goal symbol. Throw a SyntaxError exception if the parse
|
described in 6.1.4, using goal as the goal symbol. Throw a SyntaxError exception if the parse
|
||||||
fails.
|
fails.
|
||||||
...
|
|
||||||
41. Let sourceText be the string-concatenation of prefix, " anonymous(", P, 0x000A (LINE FEED),
|
|
||||||
") {", 0x000A (LINE FEED), bodyText, 0x000A (LINE FEED), and "}".
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.throws(SyntaxError, () => Function("-->"));
|
Function("-->");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user