mirror of https://github.com/tc39/test262.git
Add new tests to observe required leading line terminator (#2102)
* Add new tests to observe required leading line terminator Ref #2095
This commit is contained in:
parent
1ce8166433
commit
14c3a6e839
|
@ -0,0 +1,25 @@
|
||||||
|
// Copyright (C) 2019 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-createdynamicfunction
|
||||||
|
description: >
|
||||||
|
Function parses the body text before forming the sourceText with the proper line feed.
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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("-->"));
|
|
@ -0,0 +1,25 @@
|
||||||
|
// Copyright (C) 2019 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-createdynamicfunction
|
||||||
|
description: >
|
||||||
|
Function parses the parameters text before forming the sourceText with the proper line feed.
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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("-->", ""));
|
Loading…
Reference in New Issue