Skip to content

Commit abb7cbd

Browse files
leobalterljharb
authored andcommitted
Normative: CreateDynamicFunction early concatenates bodyText (tc39#1479)
Ref tc39/test262#2102 Ref tc39/test262#2109
1 parent 8fd2e01 commit abb7cbd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25776,7 +25776,7 @@ <h1>Runtime Semantics: CreateDynamicFunction ( _constructor_, _newTarget_, _kind
2577625776
1. Set _P_ to the string-concatenation of the previous value of _P_, *","* (a comma), and _nextArgString_.
2577725777
1. Set _k_ to _k_ + 1.
2577825778
1. Let _bodyText_ be _args_[_k_].
25779-
1. Set _bodyText_ to ? ToString(_bodyText_).
25779+
1. Set _bodyText_ to be the string-concatenation of 0x000A (LINE FEED), ? ToString(_bodyText_), and 0x000A (LINE FEED).
2578025780
1. Perform the following substeps in an implementation-dependent order, possibly interleaving parsing and error detection:
2578125781
1. Let _parameters_ be the result of parsing _P_, interpreted as UTF-16 encoded Unicode text as described in <emu-xref href="#sec-ecmascript-language-types-string-type"></emu-xref>, using _parameterGoal_ as the goal symbol. Throw a *SyntaxError* exception if the parse fails.
2578225782
1. Let _body_ be the result of parsing _bodyText_, interpreted as UTF-16 encoded Unicode text as described in <emu-xref href="#sec-ecmascript-language-types-string-type"></emu-xref>, using _goal_ as the goal symbol. Throw a *SyntaxError* exception if the parse fails.
@@ -25809,7 +25809,7 @@ <h1>Runtime Semantics: CreateDynamicFunction ( _constructor_, _newTarget_, _kind
2580925809
1. NOTE: Async functions are not constructable and do not have a [[Construct]] internal method or a *"prototype"* property.
2581025810
1. Perform SetFunctionName(_F_, *"anonymous"*).
2581125811
1. Let _prefix_ be the prefix associated with _kind_ in <emu-xref href="#table-dynamic-function-sourcetext-prefixes"></emu-xref>.
25812-
1. Let _sourceText_ be the string-concatenation of _prefix_, *" anonymous("*, _P_, 0x000A (LINE FEED), *") {"*, 0x000A (LINE FEED), _bodyText_, 0x000A (LINE FEED), and *"}"*.
25812+
1. Let _sourceText_ be the string-concatenation of _prefix_, `" anonymous("`, _P_, 0x000A (LINE FEED), `") {"`, _bodyText_, and `"}"`.
2581325813
1. Set _F_.[[SourceText]] to _sourceText_.
2581425814
1. Return _F_.
2581525815
</emu-alg>

0 commit comments

Comments
 (0)