Skip to content

Commit 0eca666

Browse files
kinowmr-c
authored andcommitted
Clarify $() and ${}
1 parent c4ebcec commit 0eca666

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

concepts.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -602,17 +602,21 @@ requirement `InlineJavascriptRequirement`. Expressions may be used in any
602602
field permitting the pseudo-type `Expression`, as specified by this
603603
document.
604604

605-
Expressions are denoted by the syntax `$(...)` or `${...}`. A code
606-
fragment wrapped in the `$(...)` syntax must be evaluated as a
607-
[ECMAScript expression](http://www.ecma-international.org/ecma-262/5.1/#sec-11). A
608-
code fragment wrapped in the `${...}` syntax must be evaluated as a
605+
Expressions are denoted by the syntax `$(...)` or `${...}`.
606+
607+
A code fragment wrapped in the `$(...)` syntax must be evaluated as a
608+
[ECMAScript expression](http://www.ecma-international.org/ecma-262/5.1/#sec-11).
609+
610+
A code fragment wrapped in the `${...}` syntax must be evaluated as a
609611
[ECMAScript function body](http://www.ecma-international.org/ecma-262/5.1/#sec-13)
610-
for an anonymous, zero-argument function. Expressions must return a valid JSON
611-
data type: one of null, string, number, boolean, array, object. Other return
612-
values must result in a `permanentFailure`. Implementations must permit any
613-
syntactically valid Javascript and account for nesting of parenthesis or braces
614-
and that strings that may contain parenthesis or braces when scanning for
615-
expressions.
612+
for an anonymous, zero-argument function. This means the code will be
613+
evaluated as `(function() { ... })()`.
614+
615+
Expressions must return a valid JSON data type: one of null, string, number,
616+
boolean, array, object. Other return values must result in a
617+
`permanentFailure`. Implementations must permit any syntactically valid
618+
Javascript and account for nesting of parenthesis or braces and that strings
619+
that may contain parenthesis or braces when scanning for expressions.
616620

617621
The runtime must include any code defined in the ["expressionLib" field of
618622
InlineJavascriptRequirement](#InlineJavascriptRequirement) prior to

0 commit comments

Comments
 (0)