Skip to content

Commit

Permalink
Fix tests for HTML comments in function body evaluation (#2109)
Browse files Browse the repository at this point in the history
  • Loading branch information
leobalter authored Jun 19, 2020
1 parent 8d3dd2d commit 5908ed2
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,19 @@
/*---
esid: sec-createdynamicfunction
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: |
The HTMLCloseComment requires a preceding line terminator.
Runtime Semantics: CreateDynamicFunction(constructor, newTarget, kind, args)
...
16. Set bodyText to ? ToString(bodyText).
17. Let parameters be the result of parsing P, interpreted as UTF-16 encoded Unicode text as
Set bodyText to ? ToString(bodyText).
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
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
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("-->");

0 comments on commit 5908ed2

Please sign in to comment.