« Bugzilla Issues Index
#4345 — 15.1.7 ScriptEvaluation: Return NormalCompletion(undefined) in step 1
- bug_id:
4345
- creation_ts:
2015-04-29 10:15:00 -0700
- short_desc:
15.1.7 ScriptEvaluation: Return NormalCompletion(undefined) in step 1
- delta_ts:
2015-12-15 11:57:44 -0800
- product:
Draft for 7th Edition
- component:
Deferred from 6th edition
- version:
unspecified
- rep_platform:
All
- op_sys:
All
- bug_status:
RESOLVED
- resolution:
FIXED
- priority:
Normal
- bug_severity:
enhancement
- everconfirmed:
true
- reporter:
André Bargull
- assigned_to:
Allen Wirfs-Brock
- cc:
brterlso
- commentid:
14347
- comment_count:
0
- who:
André Bargull
- bug_when:
2015-04-29 10:15:24 -0700
15.1.7 Runtime Semantics: ScriptEvaluation
Step 1 should probably be changed to:
---
If ScriptBody is not present, return NormalCompletion(undefined).
---
- commentid:
14364
- comment_count:
1
- who:
Allen Wirfs-Brock
- bug_when:
2015-04-29 17:29:01 -0700
empty is what previous editions returned for empty scripts. It isn't clear that there is any reason to change that.
- commentid:
14369
- comment_count:
2
- who:
André Bargull
- bug_when:
2015-04-30 07:58:39 -0700
Previous editions also returned an empty completion value for:
---
; // empty statement
function f() { } // function declaration
{ } // block
---
It doesn't really matter if empty scripts return NormalCompletion(empty) or NormalCompletion(undefined), since the completion value is not detectable by user code, but giving it the same completion value like empty modules and empty eval-scripts seems reasonable. (eval-scripts -> PerformEval, step 4; modules -> 15.2.1.20, first algorithm)
If you don't want to make this change now, maybe defer to ES7 ?
- commentid:
14418
- comment_count:
3
- who:
Allen Wirfs-Brock
- bug_when:
2015-05-19 10:19:40 -0700
defer to ES7
- commentid:
14906
- comment_count:
4
- who:
Brian Terlson
- bug_when:
2015-12-15 11:57:44 -0800
Fixed in ES2016 Draft (698819c).