-
Notifications
You must be signed in to change notification settings - Fork 68
/
x12.html
1685 lines (1678 loc) · 56.9 KB
/
x12.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html class="split chapter"><head><meta charset="utf-8"><title>12 Statements # Ⓣ Ⓔ ① Ⓐ — Annotated ES5</title><link rel="stylesheet" href="style.css"><link href="x11.html" title="11 Expressions " rel="prev">
<link href="spec.html" title="TOC" rel="index">
<link href="x13.html" title="13 Function Definition " rel="next">
</head><body><div class="head">
<h2 id="top">Annotated ECMAScript 5.1 <span id="timestamp"></span></h2>
<div id="mascot-treehouse">
<img id="mascot" align="left" src="js-mascot.svg" alt=""><img id="bubble" src="bubble.svg" alt=""></div>
<p id="slogan">‟Ex igne vita”</p>
<div id="annotations"></div>
<script src="timestamp.js"></script></div>
<nav>
<a href="x11.html">← 11 Expressions </a> –
<a href="spec.html" class="toc-nav">TOC</a> –
<a href="x13.html">13 Function Definition →</a>
<ol class="toc"><li><a href="x12.html#x12" id="x12-toc">12 Statements</a>
<b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> <ol><li><a href="x12.html#x12.1" id="x12.1-toc">12.1 Block</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x12.html#x12.2" id="x12.2-toc">12.2 Variable Statement</a>
<b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> <ol><li><a href="x12.html#x12.2.1" id="x12.2.1-toc">12.2.1 Strict Mode Restrictions</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li></ol></li><li><a href="x12.html#x12.3" id="x12.3-toc">12.3 Empty Statement</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x12.html#x12.4" id="x12.4-toc">12.4 Expression Statement</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x12.html#x12.5" id="x12.5-toc">12.5 The if Statement</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x12.html#x12.6" id="x12.6-toc">12.6 Iteration Statements</a>
<b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> <ol><li><a href="x12.html#x12.6.1" id="x12.6.1-toc">12.6.1 The do-while Statement</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x12.html#x12.6.2" id="x12.6.2-toc">12.6.2 The while Statement</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x12.html#x12.6.3" id="x12.6.3-toc">12.6.3 The for Statement</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x12.html#x12.6.4" id="x12.6.4-toc">12.6.4 The for-in Statement</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li></ol></li><li><a href="x12.html#x12.7" id="x12.7-toc">12.7 The continue Statement</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x12.html#x12.8" id="x12.8-toc">12.8 The break Statement</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x12.html#x12.9" id="x12.9-toc">12.9 The return Statement</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x12.html#x12.10" id="x12.10-toc">12.10 The with Statement</a>
<b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> <ol><li><a href="x12.html#x12.10.1" id="x12.10.1-toc">12.10.1 Strict Mode Restrictions</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li></ol></li><li><a href="x12.html#x12.11" id="x12.11-toc">12.11 The switch Statement</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x12.html#x12.12" id="x12.12-toc">12.12 Labelled Statements</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x12.html#x12.13" id="x12.13-toc">12.13 The throw Statement</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x12.html#x12.14" id="x12.14-toc">12.14 The try Statement</a>
<b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> <ol><li><a href="x12.html#x12.14.1" id="x12.14.1-toc">12.14.1 Strict Mode Restrictions</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li></ol></li><li><a href="x12.html#x12.15" id="x12.15-toc">12.15 The debugger statement</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li></ol></li></ol></nav>
<h2 id="x12">12 Statements <a href="#x12">#</a> <a href="#x12-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h2>
<p class="tiny-btm">
<b>Syntax</b></p>
<p class="keep">
<i>Statement </i><b>:</b></p>
<p class="def1-btm">
<i>Block<br>VariableStatement<br>EmptyStatement<br>ExpressionStatement<br>IfStatement<br>IterationStatement<br>ContinueStatement<br>BreakStatement<br>ReturnStatement<br>WithStatement<br>LabelledStatement<br>SwitchStatement<br>ThrowStatement<br>TryStatement<br>DebuggerStatement</i></p>
<p class="tiny-btm">
<b>Semantics</b></p>
<p>
A
<i>Statement</i> can be
part of a <i>LabelledStatement</i>,
which itself can be part of a <i>LabelledStatement</i>,
and so on. The labels introduced this way are collectively referred
to as the “current label set” when describing the semantics of
individual statements. A <i>LabelledStatement</i>
has no semantic meaning other than the introduction of a label to a
<i>label set</i>. The label set of an <i>IterationStatement</i>
or a<i> SwitchStatement</i>
initially contains the single element <b>empty</b>. The label set of
any other statement is initially empty.</p>
<p><b class="note">NOTE</b> Several
widely used implementations of ECMAScript are known to support the
use of FunctionDeclaration
as a Statement. However
there are significant and irreconcilable variations among the
implementations in the semantics applied to such
<i>FunctionDeclarations</i>.
Because of these irreconcilable difference, the use of a
<i>FunctionDeclaration</i>
as a <i>Statement</i>
results in code that is not reliably portable among implementations.
It is recommended that ECMAScript implementations either disallow
this usage of <i>FunctionDeclaration</i>
or issue a warning when such a usage is encountered. Future editions
of ECMAScript may define alternative portable means for declaring
functions in a <i>Statement</i>
context.</p>
<h3 id="x12.1">12.1 Block <a href="#x12.1">#</a> <a href="#x12.1-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h3>
<p class="tiny-btm">
<b>Syntax</b></p>
<p class="keep">
<i>Block </i><b>:</b></p>
<p class="def1-btm">
<code><b>{</b></code> <i>StatementList</i><sub>opt</sub><code><b>}</b></code></p>
<p class="keep">
<i>StatementList </i><b>:</b></p>
<p class="def1-btm">
<i>Statement<br>StatementList
Statement</i></p>
<p class="tiny-btm">
<b>Semantics</b></p>
<p>
The
production <i>Block </i><b>:</b> <code><b>{</b></code> <code><b>}</b></code><b>
</b>is evaluated as follows:</p>
<ol><li><p>
Return
(<b>normal</b>, <b>empty</b>, <b>empty</b>).</p>
</li></ol><p>
The
production <i>Block </i><b>:</b> <code><b>{</b></code>
<i>StatementList</i> <code><b>}</b></code>is
evaluated as follows:</p>
<ol><li><p>
Return
the result of evaluating <i>StatementList</i>.</p>
</li></ol><p>
The
production <i>StatementList </i><b>:</b><i>Statement</i> is evaluated as follows:</p>
<ol><li><p>
Let
<i>s</i> be the result of evaluating <i>Statement</i>.</p>
</li>
<li><p>
If
an exception was thrown, return (throw,
<i>V</i>, empty) where <i>V</i>
is the exception. (Execution now proceeds as if no exception were
thrown.)</p>
</li>
<li><p>
Return
<i>s</i>.</p>
</li></ol><p>
The
production <i>StatementList </i><b>:</b><i>StatementList Statement</i> is evaluated as follows:</p>
<ol><li><p>
Let
<i>sl</i> be the result of evaluating <i>StatementList</i>.</p>
</li>
<li><p>
If
<i>sl</i> is an <a href="x8.html#x8.9">abrupt completion</a>, return <i>sl</i>.</p>
</li>
<li><p>
Let
<i>s</i> be the result of evaluating <i>Statement</i>.</p>
</li>
<li><p>
If
an exception was thrown, return (throw,
<i>V</i>, empty) where <i>V</i>
is the exception. (Execution now proceeds as if no exception were
thrown.)</p>
</li>
<li><p>
If
<i>s</i>.value is empty, let
<i>V</i> = <i>sl</i>.value, otherwise let <i>V</i> = <i>s</i>.value.</p>
</li>
<li><p>
Return
(<i>s</i>.type, <i>V</i>, <i>s</i>.target).</p>
</li></ol><h3 id="x12.2">12.2 Variable Statement <a href="#x12.2">#</a> <a href="#x12.2-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h3>
<p class="tiny-btm">
<b>Syntax</b></p>
<p class="keep">
<i>VariableStatement </i><b>:</b></p>
<p class="def1-btm">
<code><b>var</b></code> <i>VariableDeclarationList </i><code><b>;</b></code></p>
<p class="keep">
<i>VariableDeclarationList </i><b>:</b></p>
<p class="def1-btm">
<i>VariableDeclaration<br>VariableDeclarationList </i><code><b>,</b></code> <i>VariableDeclaration</i></p>
<p class="keep">
<i>VariableDeclarationListNoIn </i><b>:</b></p>
<p class="def1-btm">
<i>VariableDeclarationNoIn<br>VariableDeclarationListNoIn </i><code><b>,</b></code> <i>VariableDeclarationNoIn</i></p>
<p class="keep">
<i>VariableDeclaration </i><b>:</b></p>
<p class="def1-btm">
<i>Identifier
Initialiser</i><sub>opt</sub></p>
<p class="keep">
<i>VariableDeclarationNoIn </i><b>:</b></p>
<p class="def1-btm">
<i>Identifier
InitialiserNoIn</i><sub>opt</sub></p>
<p class="keep">
<i>Initialiser </i><b>:</b></p>
<p class="def1-btm">
<code><b>=</b></code> <i>AssignmentExpression</i></p>
<p class="keep">
<i>InitialiserNoIn </i><b>:</b></p>
<p class="def1-btm">
<code><b>=</b></code> <i>AssignmentExpressionNoIn</i></p>
<p>
A
variable statement declares variables that are created as defined in
<a href="x10.html#x10.5">10.5</a>. Variables are initialised to <b>undefined</b> when created. A
variable with an <i>Initialiser</i>
is assigned the value of its <i>AssignmentExpression</i>
when the <i>VariableStatement</i>
is executed, not when the variable is created.</p>
<p class="tiny-btm">
<b>Semantics</b></p>
<p>
The
production <i>VariableStatement </i><b>:</b><i> </i><code><b>var</b></code> <i>VariableDeclarationList </i><code><b>;</b></code>
is evaluated as follows:</p>
<ol><li><p>
Evaluate
<i>VariableDeclarationList</i>.</p>
</li>
<li><p>
Return
(normal, empty,
empty).</p>
</li></ol><p>
The
production <i>VariableDeclarationList</i>
<b>:</b> <i>VariableDeclaration</i>
is evaluated as follows:</p>
<ol><li><p>
Evaluate
<i>VariableDeclaration</i>.</p>
</li></ol><p>
The
production <i>VariableDeclarationList</i>
<b>:</b> <i>VariableDeclarationList</i>
<code><b>,</b></code>
<i>VariableDeclaration</i>
is evaluated as follows:</p>
<ol><li><p>
Evaluate
<i>VariableDeclarationList</i>.</p>
</li>
<li><p>
Evaluate
<i>VariableDeclaration</i>.</p>
</li></ol><p>
The
production <i>VariableDeclaration </i><b>:</b> <i>Identifier</i> is evaluated as follows:</p>
<ol><li><p>
Return
a String value containing the same sequence of characters as in the
<i>Identifier</i>.</p>
</li></ol><p>
The
production <i>VariableDeclaration</i>
<b>:</b> <i>Identifier
Initialiser</i> is evaluated as follows:</p>
<ol><li><p>
Let
<i>lhs</i> be the result of evaluating <i>Identifier</i> as
described in <a href="x11.html#x11.1.2">11.1.2</a>.</p>
</li>
<li><p>
Let
<i>rhs </i>be the result of evaluating <i>Initialiser</i>.</p>
</li>
<li><p>
Let
<i>value </i>be <a href="x8.html#x8.7.1">GetValue</a>(<i>rhs</i>).</p>
</li>
<li><p>
Call
<a href="x8.html#x8.7.2">PutValue</a>(<i>lhs</i>, <i>value</i>).</p>
</li>
<li><p>
Return
a String value containing the same sequence of characters as in the
<i>Identifier</i>.</p>
</li></ol><p><b class="note">NOTE</b> The
String value of a <i>VariableDeclaration</i>
is used in the evaluation of for-in statements (<a href="#x12.6.4">12.6.4</a>).</p>
<p>
If a
<i>VariableDeclaration</i>
is nested within a with statement and the Identifier in the
<i>VariableDeclaration</i>
is the same as a property name of the <a href="x10.html#x10.2.1.2">binding object</a> of the with
statement’s object <a href="x10.html#x10.2">environment record</a>, then step 4 will assign
value to the property instead of to the VariableEnvironment binding
of the <i>Identifier</i>.</p>
<p>
The
production <i>Initialiser </i><b>:</b> <code><b>=</b></code> <i>AssignmentExpression</i> is evaluated as follows:</p>
<ol><li><p>
Return
the result of evaluating <i>AssignmentExpression</i>.</p>
</li></ol><p>
The
<i>VariableDeclarationListNoIn</i>,
<i>VariableDeclarationNoIn</i>
and <i>InitialiserNoIn</i>
productions are evaluated in the same manner as the
<i>VariableDeclarationList</i>,
<i>VariableDeclaration</i>
and <i>Initialiser</i>
productions except that the contained <i>VariableDeclarationListNoIn</i>,
<i>VariableDeclarationNoIn</i>,
<i>InitialiserNoIn</i>
and <i>AssignmentExpressionNoIn</i>
are evaluated instead of the contained <i>VariableDeclarationList</i>,
<i>VariableDeclaration</i>,
<i>Initialiser</i> and
<i>AssignmentExpression</i>,
respectively.</p>
<h4 id="x12.2.1">12.2.1 Strict Mode Restrictions <a href="#x12.2.1">#</a> <a href="#x12.2.1-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h4>
<p>
It is
a <b><a href="x15.11.html#x15.11.6.4" class="term-ref">SyntaxError</a></b> if a <i>VariableDeclaration</i>
or <i>VariableDeclarationNoIn</i>
occurs within <a href="x10.html#x10.1.1">strict code</a> and its <i>Identifier</i>
is either <code><b>"eval"</b></code><b>
or </b><code><b>"arguments"</b></code>.</p>
<h3 id="x12.3">12.3 Empty Statement <a href="#x12.3">#</a> <a href="#x12.3-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h3>
<p class="tiny-btm">
<b>Syntax</b></p>
<p class="keep">
<i>EmptyStatement </i><b>:</b></p>
<p class="def1-btm">
<i>;</i></p>
<p class="tiny-btm">
<b>Semantics</b></p>
<p>
The
production <i>EmptyStatement </i><b>:</b> <code><b>;</b></code> is
evaluated as follows:</p>
<ol><li><p>
Return
(normal,
empty, empty).</p>
</li></ol><h3 id="x12.4">12.4 Expression Statement <a href="#x12.4">#</a> <a href="#x12.4-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h3>
<p class="tiny-btm">
<b>Syntax</b></p>
<p class="keep">
<i>ExpressionStatement </i><b>:</b></p>
<p class="def1-btm">
[<a href="x5.html#lookahead-not-in">lookahead
<span class="symbol">∉</span></a>
{<code><b>{</b></code>,<code><b>
function</b></code>}] <i>Expression </i><code><b>;</b></code></p>
<p><b class="note">NOTE</b> An
<i>ExpressionStatement</i>
cannot start with an opening curly brace because that might make it
ambiguous with a <i>Block</i>.
Also, an <i>ExpressionStatement</i>
cannot start with the <code><b>function</b></code>
keyword because that might make it ambiguous with a
<i>FunctionDeclaration</i>.</p>
<p class="tiny-btm">
<b>Semantics</b></p>
<p>
The
production <i>ExpressionStatement </i><b>:</b> [<a href="x5.html#lookahead-not-in">lookahead <span class="symbol">∉</span></a>
{<code><b>{</b></code><b>,</b><code><b>
function</b></code>}]<i>Expression</i><code><b>;</b></code>
is evaluated as follows:</p>
<ol><li><p>
Let
<i>exprRef</i> be the result of evaluating <i>Expression</i>.</p>
</li>
<li><p>
Return
(normal, <a href="x8.html#x8.7.1">GetValue</a>(<i>exprRef</i>),
empty).</p>
</li></ol><h3 id="x12.5">12.5 The if Statement <a href="#x12.5">#</a> <a href="#x12.5-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h3>
<p class="tiny-btm">
<b>Syntax</b></p>
<p class="keep">
<i>IfStatement </i><b>:</b></p>
<p class="def1-btm">
<code><b>if</b></code> <code><b>(</b></code> <i>Expression </i><code><b>)</b></code> <i>Statement </i><code><b>else</b></code> <i>Statement<br></i><code><b>if</b></code> <code><b>(</b></code> <i>Expression </i><code><b>)</b></code> <i>Statement</i></p>
<p>
Each
<code><b>else</b></code> for which the
choice of associated <code><b>if</b></code>
is ambiguous shall be associated with the nearest possible <b>if</b>
that would otherwise have no corresponding <code><b>else</b></code>.</p>
<p class="tiny-btm">
<b>Semantics</b></p>
<p>
The
production <i>IfStatement </i><b>:</b> <code><b>if</b></code> <code><b>(</b></code> <i>Expression </i><code><b>)</b></code> <i>Statement </i><code><b>else</b></code> <i>Statement</i> is evaluated as follows:</p>
<ol><li><p>
Let
<i>exprRef</i> be the result of evaluating <i>Expression</i>.</p>
</li>
<li><p>
If
<a href="x9.html#x9.2">ToBoolean</a>(<a href="x8.html#x8.7.1">GetValue</a>(<i>exprRef</i>)) is <b>true</b>, then</p>
<ol><li><p>
Return
the result of evaluating the first <i>Statement</i>.</p>
</li></ol></li>
<li><p>
Else,</p>
<ol><li><p>
Return
the result of evaluating the second <i>Statement</i>.</p>
</li></ol></li></ol><p>
The
production <i>IfStatement </i><b>:</b> <code><b>if</b></code> <code><b>(</b></code> <i>Expression </i><code><b>)</b></code> <i>Statement</i> is evaluated as follows:</p>
<ol><li><p>
Let
<i>exprRef</i> be the result of evaluating <i>Expression</i>.</p>
</li>
<li><p>
If
<a href="x9.html#x9.2">ToBoolean</a>(<a href="x8.html#x8.7.1">GetValue</a>(<i>exprRef</i>)) is <b>false</b>, return
(normal, empty,
empty).</p>
</li>
<li><p>
Return
the result of evaluating <i>Statement</i>.</p>
</li></ol><h3 id="x12.6">12.6 Iteration Statements <a href="#x12.6">#</a> <a href="#x12.6-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h3>
<p class="tiny-btm">
<b>Syntax</b></p>
<p class="keep">
<i>IterationStatement </i><b>:</b></p>
<p class="def1-btm">
<code><b>do
</b></code> <i>Statement</i><code><b>
while</b></code> <i> </i><code><b>(</b></code> <i>Expression </i><code><b>);</b></code> <i><br></i><code><b>while</b></code> <code><b>(</b></code> <i>Expression </i><code><b>)</b></code> <i>Statement<br></i><code><b>for</b></code> <code><b>(</b></code> <i>ExpressionNoIn</i><sub>opt</sub><code><b>;</b></code> <i>Expression</i><sub>opt</sub><code><b>;</b></code> <i>Expression</i><sub>opt</sub><code><b>)</b></code> <i>Statement<br></i><code><b>for</b></code> <code><b>(</b></code> <code><b>var</b></code> <i>VariableDeclarationListNoIn</i><code><b>;</b></code> <i>Expression</i><sub>opt</sub><code><b>;</b></code> <i>Expression</i><sub>opt</sub><code><b>)</b></code> <i>Statement<br></i><code><b>for</b></code> <code><b>(</b></code> <i>LeftHandSideExpression </i><code><b>in</b></code> <i>Expression </i><code><b>)</b></code> <i>Statement<br></i><code><b>for</b></code> <code><b>(</b></code> <code><b>var</b></code> <i>VariableDeclarationNoIn </i><code><b>in</b></code> <i>Expression </i><code><b>)</b></code> <i>Statement</i></p>
<h4 id="x12.6.1">12.6.1 The do-while Statement <a href="#x12.6.1">#</a> <a href="#x12.6.1-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h4>
<p>
The
production <code><b>do</b></code> <i>Statement </i><code><b>while</b></code> <code><b>(</b></code> <i>Expression </i><code><b>);</b></code>
is evaluated as follows:</p>
<ol><li><p>
Let
<i>V</i> = empty.</p>
</li>
<li><p>
Let
<i>iterating</i> be <b>true</b>.</p>
</li>
<li><p>
Repeat,
while <i>iterating</i> is <b>true</b></p>
<ol><li><p>
Let
<i>stmt</i> be the result of evaluating <i>Statement</i>.</p>
</li>
<li><p>
If
<i>stmt</i>.value is not empty,
let <i>V</i> = <i>stmt</i>.value<i>.</i></p>
</li>
<li><p>
If
<i>stmt</i>.type is not continue
|| <i>stmt</i>.target is not in the current label set, then</p>
<ol><li><p>
If
<i>stmt</i>.type is break
and <i>stmt</i>.target is in the current label set, return
(normal, <i>V</i>, empty).</p>
</li>
<li><p>
If
<i>stmt</i> is an <a href="x8.html#x8.9">abrupt completion</a>, return <i>stmt</i>.</p>
</li></ol></li>
<li><p>
Let
<i>exprRef</i> be the result of evaluating <i>Expression</i>.</p>
</li>
<li><p>
If
<a href="x9.html#x9.2">ToBoolean</a>(<a href="x8.html#x8.7.1">GetValue</a>(<i>exprRef</i>)) is <b>false</b>, set <i>iterating</i>
to <b>false</b>.</p>
</li></ol></li>
<li><p>
Return
(normal, <i>V</i>, empty);</p>
</li></ol><h4 id="x12.6.2">12.6.2 The while Statement <a href="#x12.6.2">#</a> <a href="#x12.6.2-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h4>
<p>
The
production <i>IterationStatement </i><b>:</b><i> </i><code><b>while</b></code> <code><b>(</b></code> <i>Expression </i><code><b>)</b></code> <i>Statement</i> is evaluated as follows:</p>
<ol><li><p>
Let
<i>V</i> = empty.</p>
</li>
<li><p>
Repeat</p>
<ol><li><p>
Let
<i>exprRef</i> be the result of evaluating <i>Expressio</i>n.</p>
</li>
<li><p>
If
<a href="x9.html#x9.2">ToBoolean</a>(<a href="x8.html#x8.7.1">GetValue</a>(<i>exprRef</i>)) is <b>false</b>, return
(normal, <i>V</i>, empty).</p>
</li>
<li><p>
Let
<i>stmt</i> be the result of evaluating <i>Statement</i>.</p>
</li>
<li><p>
If
<i>stmt</i>.value is not empty,
let <i>V</i> = <i>stmt</i>.value.</p>
</li>
<li><p>
If
<i>stmt</i>.type is not continue
|| <i>stmt</i>.target is not in the current label set, then</p>
<ol><li><p>
If
<i>stmt</i>.type is break
and <i>stmt</i>.target is in the current label set, then</p>
<ol><li><p>
Return
(normal, <i>V</i>, empty).</p>
</li></ol></li>
<li><p>
If
<i>stmt</i> is an <a href="x8.html#x8.9">abrupt completion</a>, return <i>stmt</i>.</p>
</li></ol></li></ol></li></ol><h4 id="x12.6.3">12.6.3 The for Statement <a href="#x12.6.3">#</a> <a href="#x12.6.3-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h4>
<p>
The
production<br><i>IterationStatement</i>
<b>:</b> <code><b>for</b></code>
<code><b>(</b></code> <i>ExpressionNoIn</i><sub>opt</sub><code><b>;</b></code> <i>Expression</i><sub>opt</sub><code><b>;</b></code> <i>Expression</i><sub>opt</sub><code><b>)</b></code>
<i>Statement</i><br>is
evaluated as follows:</p>
<ol><li><p>
If
<i>ExpressionNoIn</i> is present, then.</p>
<ol><li><p>
Let
<i>exprRef</i> be the result of evaluating <i>ExpressionNoIn</i>.</p>
</li>
<li><p>
Call
<a href="x8.html#x8.7.1">GetValue</a>(<i>exprRef</i>). (This value is not used.)</p>
</li></ol></li>
<li><p>
Let
<i>V</i> = empty.</p>
</li>
<li><p>
Repeat</p>
<ol><li><p>
If
the first <i>Expression</i> is present, then</p>
<ol><li><p>
Let
<i>testExprRef</i> be the result of evaluating the first
<i>Expressio</i>n.</p>
</li>
<li><p>
If
<a href="x9.html#x9.2">ToBoolean</a>(<a href="x8.html#x8.7.1">GetValue</a>(<i>testExprRef</i>)) is <b>false</b>, return (normal,
<i>V</i>, empty).</p>
</li></ol></li>
<li><p>
Let
<i>stmt</i> be the result of evaluating <i>Statement</i>.</p>
</li>
<li><p>
If
<i>stmt</i>.value is not empty,
let <i>V</i> = <i>stmt</i>.value</p>
</li>
<li><p>
If
<i>stmt</i>.type is break
and <i>stmt</i>.target is in the current label set, return
(<b>normal</b>, <i>V</i>, <b>empty</b>).</p>
</li>
<li><p>
If
<i>stmt</i>.type is not continue
|| <i>stmt</i>.target is not in the current label set, then</p>
<ol><li><p>
If
<i>stmt</i> is an <a href="x8.html#x8.9">abrupt completion</a>, return <i>stmt</i>.</p>
</li></ol></li>
<li><p>
If
the second <i>Expression</i> is present, then</p>
<ol><li><p>
Let
<i>incExprRef</i> be the result of evaluating the second
<i>Expressio</i>n.</p>
</li>
<li><p>
Call
<a href="x8.html#x8.7.1">GetValue</a>(<i>incExprRef</i>). (This value is not used.)</p>
</li></ol></li></ol></li></ol><p>
The
production<br><i>IterationStatement</i>
<b>:</b> <code><b>for</b></code> <code><b>(</b></code>
<code><b>var</b></code>
<i>VariableDeclarationListNoIn</i>
<code><b>;</b></code> <i>Expression</i><sub>opt</sub><code><b>;</b></code>
<i>Expression</i><sub>opt</sub><code><b>)</b></code> <i>Statement</i><br>is
evaluated as follows:</p>
<ol><li><p>
Evaluate
<i>VariableDeclarationListNoIn</i>.</p>
</li>
<li><p>
Let
V = empty.</p>
</li>
<li><p>
Repeat</p>
<ol><li><p>
If
the first <i>Expression</i> is present, then</p>
<ol><li><p>
Let
<i>testExprRef</i> be the result of evaluating the first
<i>Expression</i>.</p>
</li>
<li><p>
If
<a href="x9.html#x9.2">ToBoolean</a>(<a href="x8.html#x8.7.1">GetValue</a>(<i>testExprRef</i>)) is <b>false</b>, then return
(normal, V, empty).</p>
</li>
</ol></li>
<li><p>
Let
<i>stmt</i> be the result of evaluating <i>Statement</i>.</p>
</li>
<li><p>
If
<i>stmt</i>.value is not empty,
let V = <i>stmt</i>.value.</p>
</li>
<li><p>
If
<i>stmt</i>.type is break
and <i>stmt</i>.target is in the current label set, return
(<b>normal</b>, V, <b>empty</b>).</p>
</li>
<li><p>
If
<i>stmt</i>.type is not continue
|| <i>stmt</i>.target is not in the current label set, then</p>
<ol><li><p>
If
<i>stmt</i> is an <a href="x8.html#x8.9">abrupt completion</a>, return <i>stmt</i>.</p>
</li></ol></li>
<li><p>
If
the second <i>Expression</i> is present, then.</p>
<ol><li><p>
Let
<i>incExprRef</i> be the result of evaluating the second
<i>Expression</i>.</p>
</li>
<li><p>
Call
<a href="x8.html#x8.7.1">GetValue</a>(<i>incExprRef</i>). (This value is not used.)</p>
</li></ol></li></ol></li></ol><h4 id="x12.6.4">12.6.4 The for-in Statement <a href="#x12.6.4">#</a> <a href="#x12.6.4-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h4>
<p>
The
production <i>IterationStatement</i>
<b>:</b> <code><b>for</b></code> <code><b>(</b></code><b>
</b><i>LeftHandSideExpression</i>
<code><b>in</b></code> <i>Expression</i>
<code><b>)</b></code> <i>Statement</i>
is evaluated as follows:</p>
<ol><li><p>
Let
<i>exprRef</i> be the result of evaluating the <i>Expression</i>.</p>
</li>
<li><p>
Let
<i>experValue</i> be <a href="x8.html#x8.7.1">GetValue</a>(<i>exprRef</i>).</p>
</li>
<li><p>
If
<i>experValue</i> is <b>null</b> or <b>undefined</b>, return
(normal, empty,
empty).</p>
</li>
<li><p>
Let
<i>obj</i> be <a href="x9.html#x9.9">ToObject</a>(<i>experValue</i>).</p>
</li>
<li><p>
Let
<i>V</i> = empty.</p>
</li>
<li><p>
Repeat</p>
<ol><li><p>
Let
<i>P</i> be the name of the next property of <i>obj</i> whose
[[Enumerable]] attribute is <b>true</b>. If there is no such
property, return (normal, <i>V</i>,
empty).</p>
</li>
<li><p>
Let
<i>lhsRef</i> be the result of evaluating the
<i>LeftHandSideExpression</i> ( it may be evaluated repeatedly).</p>
</li>
<li><p>
Call
<a href="x8.html#x8.7.2">PutValue</a>(<i>lhsRef</i>, <i>P</i>).</p>
</li>
<li><p>
Let
<i>stmt</i> be the result of evaluating <i>Statement</i>.</p>
</li>
<li><p>
If
<i>stmt</i>.value is not empty,
let <i>V</i> = <i>stmt</i>.value.</p>
</li>
<li><p>
If
<i>stmt</i>.type is break
and <i>stmt</i>.target is in the current label set, return
(normal, <i>V</i>, empty).</p>
</li>
<li><p>
If
<i>stmt</i>.type is not <b>continue</b> || <i>stmt</i>.target is
not in the current label set, then</p>
<ol><li><p>
If
<i>stmt</i> is an <a href="x8.html#x8.9">abrupt completion</a>, return <i>stmt</i>.</p>
</li></ol></li></ol></li></ol><p>
The
production<br><i>IterationStatement</i>
<b>:</b> <code><b>for</b></code> <code><b>(</b></code>
<code><b>var</b></code>
<i>VariableDeclarationNoIn</i>
<code><b>in</b></code> <i>Expression</i>
<code><b>)</b></code> <i>Statement</i><br>is
evaluated as follows:</p>
<ol><li><p>
Let
<i>varName</i> be the result of evaluating <i>VariableDeclarationNoIn</i>.</p>
</li>
<li><p>
Let
<i>exprRef</i> be the result of evaluating the <i>Expression</i>.</p>
</li>
<li><p>
Let
<i>experValue</i> be <a href="x8.html#x8.7.1">GetValue</a>(<i>exprRef</i>).</p>
</li>
<li><p>
If
<i>experValue</i> is <b>null</b> or <b>undefined</b>, return
(normal, empty,
empty).</p>
</li>
<li><p>
Let
<i>obj</i> be <a href="x9.html#x9.9">ToObject</a>(<i>experValue</i>).</p>
</li>
<li><p>
Let
<i>V</i> = empty.</p>
</li>
<li><p>
Repeat</p>
<ol><li><p>
Let
<i>P</i> be the name of the next property of <i>obj</i> whose
[[Enumerable]] attribute is <b>true</b>. If there is no such
property, return (normal, <i>V</i>,
empty).</p>
</li>
<li><p>
Let
<i>varRef</i> be the result of evaluating <i>varName</i> as if it
were an Identifier Reference (<a href="x11.html#x11.1.2">11.1.2</a>); it may be evaluated
repeatedly.</p>
</li>
<li><p>
Call
<a href="x8.html#x8.7.2">PutValue</a>(<i>varRef</i>, <i>P</i>).</p>
</li>
<li><p>
Let
<i>stmt</i> be the result of evaluating <i>Statement</i>.</p>
</li>
<li><p>
If
<i>stmt</i>.value is not empty,
let <i>V</i> = <i>stmt</i>.value.</p>
</li>
<li><p>
If
<i>stmt</i>.type is break
and <i>stmt</i>.target is in the current label set, return
(normal, <i>V</i>, empty).</p>
</li>
<li><p>
If
<i>stmt</i>.type is not continue
|| <i>stmt</i>.target is not in the current label set, then</p>
<ol><li><p>
If
<i>stmt</i> is an <a href="x8.html#x8.9">abrupt completion</a>, return <i>stmt</i>.</p>
</li></ol></li></ol></li></ol><p>
The
mechanics and order of enumerating the properties (step 6.a in the
first algorithm, step 7.a in the second) is not specified.
Properties of the object being enumerated may be deleted during
enumeration. If a property that has not yet been visited during
enumeration is deleted, then it will not be visited. If new
properties are added to the object being enumerated during
enumeration, the newly added properties are not guaranteed to be
visited in the active enumeration.
A property name must not be visited more than once in any enumeration.
</p>
<p>
Enumerating
the properties of an object includes enumerating properties of its
prototype, and the prototype of the prototype, and so on,
recursively; but a property of a prototype is not enumerated if it
is “shadowed” because some previous object in the prototype
chain has a property with the same name.
The values of [[Enumerable]] attributes are not considered when
determining if a property of a prototype object is shadowed by a previous
object on the prototype chain.</p>
<p><b class="note">NOTE</b> See
NOTE <a href="x11.html#x11.13.1">11.13.1</a>.</p>
<h3 id="x12.7">12.7 The continue Statement <a href="#x12.7">#</a> <a href="#x12.7-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h3>
<p class="tiny-btm">
<b>Syntax</b></p>
<p class="keep">
<i>ContinueStatement </i><b>:</b></p>
<p class="def1-btm">
<code><b>continue</b></code> <code><b>;</b></code></p>
<p class="def1-btm">
<code><b>continue
</b></code><a href="x5.html#restricted-production">[no <i>LineTerminator</i> here]</a><i> Identifier</i><code><b>;</b></code></p>
<p class="tiny-btm">
<b>Semantics</b></p>
<p>
A
program is considered syntactically incorrect if either of the
following is true:</p>
<ul><li><p>
The
program contains a <code><b>continue</b></code>
statement without the optional <i>Identifier</i>,
which is not nested, directly or indirectly (but not crossing
function boundaries), within an <i>IterationStatement</i>.</p>
</li>
<li><p>
The
program contains a <code><b>continue</b></code>
statement with the optional <i>Identifier</i>,
where <i>Identifier</i> does
not appear in the label set of an enclosing (but not crossing
function boundaries) <i>IterationStatement</i>.</p>
</li></ul><p>
A
<i>ContinueStatement</i>
without an <i>Identifier</i>
is evaluated as follows:</p>
<ol><li><p>
Return
(continue, empty,
empty).</p>
</li></ol><p>
A
<i>ContinueStatement</i>
with the optional <i>Identifier</i>
is evaluated as follows:</p>
<ol><li><p>
Return
(continue, empty,
<i>Identifier</i>).</p>
</li></ol><h3 id="x12.8">12.8 The break Statement <a href="#x12.8">#</a> <a href="#x12.8-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h3>
<p class="tiny-btm">
<b>Syntax</b></p>
<p class="keep">
<i>BreakStatement </i><b>:</b></p>
<p class="def1-btm">
<code><b>break</b></code> <code><b>;</b></code></p>
<p class="def1-btm">
<code><b>break</b></code> <i><b>
</b></i><a href="x5.html#restricted-production">[no <i>LineTerminator</i> here]</a> <i>Identifier</i> <code><b>;</b></code></p>
<p class="tiny-btm">
<b>Semantics</b></p>
<p>
A
program is considered syntactically incorrect if either of the
following is true:</p>
<ul><li><p>
The
program contains a <code><b>break</b></code>
statement without the optional <i>Identifier</i>,
which is not nested, directly or indirectly (but not crossing
function boundaries), within an <i>IterationStatement</i>
or a <i>SwitchStatement</i>.</p>
</li>
<li><p>
The
program contains a <code><b>break</b></code>
statement with the optional <i>Identifier</i>,
where <i>Identifier</i> does
not appear in the label set of an enclosing (but not crossing
function boundaries) <i>Statement</i>.</p>
</li></ul><p>
A
<i>BreakStatement</i>
without an <i>Identifier</i>
is evaluated as follows:</p>
<ol><li><p>
Return
(break, empty,
empty).</p>
</li></ol><p>
A
<i>BreakStatement</i>
with an <i>Identifier</i>
is evaluated as follows:</p>
<ol><li><p>
Return
(break, empty,<i>Identifier</i>).</p>
</li></ol><h3 id="x12.9">12.9 The return Statement <a href="#x12.9">#</a> <a href="#x12.9-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h3>
<p class="tiny-btm">
<b>Syntax</b></p>
<p class="keep">
<i>ReturnStatement </i><b>:</b></p>
<p class="def1-btm">
<code><b>return</b></code> <code><b>;</b></code></p>
<p class="def1-btm">
<code><b>return
</b></code><a href="x5.html#restricted-production">[no <i>LineTerminator</i> here]</a><i> Expression</i> <code><b>;</b></code></p>
<p class="tiny-btm">
<b>Semantics</b></p>
<p>
An
ECMAScript program is considered syntactically incorrect if it
contains a <code><b>return</b></code>
statement that is not within a <i><a href="x13.html#x13">FunctionBody</a></i>.
A <code><b>return</b></code> statement
causes a function to cease execution and return a value to the
caller. If <i>Expression</i>
is omitted, the return value is <b>undefined</b>. Otherwise, the
return value is the value of <i>Expression</i>.</p>
<p>
The
production <i>ReturnStatement</i>
<b>:</b> <code><b>return</b></code><b>
</b><a href="x5.html#restricted-production">[no <i>LineTerminator</i> here]</a><b>
</b><i>Expression</i><sub>opt</sub><code><b>;</b></code> is
evaluated as:</p>
<ol><li><p>
If
the <i>Expression</i> is not present, return (return,
undefined, empty).</p>
</li>
<li><p>
Let
<i>exprRef</i> be the result of evaluating <i>Expression</i>.</p>
</li>
<li><p>
Return
(return, <a href="x8.html#x8.7.1">GetValue</a>(<i>exprRef</i>),
empty).</p>
</li></ol><h3 id="x12.10">12.10 The with Statement <a href="#x12.10">#</a> <a href="#x12.10-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h3>
<p class="tiny-btm">
<b>Syntax</b></p>
<p class="keep">
<i>WithStatement </i><b>:</b></p>
<p class="def1-btm">
<code><b>with</b></code> <code><b>(</b></code> <i>Expression </i><code><b>)</b></code> <i>Statement</i></p>
<p>
The
<code><b>with </b></code>statement
adds an object <a href="x10.html#x10.2">environment record</a> for a computed object to the
<a href="x10.html#x10.2">lexical environment</a> of the current execution context. It then
executes a statement using this augmented <a href="x10.html#x10.2">lexical environment</a>.
Finally, it restores the original <a href="x10.html#x10.2">lexical environment</a>.</p>
<p class="tiny-btm">
<b>Semantics</b></p>
<p>
The
production <i>WithStatement </i><b>:</b> <code><b>with</b></code> <code><b>(</b></code> <i>Expression </i><code><b>)</b></code> <i>Statement</i> is evaluated as follows:</p>
<ol><li><p>
Let
<i>val</i> be the result of evaluating <i>Expression</i>.</p>
</li>
<li><p>
Let
<i>obj</i> be <a href="x9.html#x9.9">ToObject</a>(<a href="x8.html#x8.7.1">GetValue</a>(<i>val</i>)).</p>
</li>
<li><p>
Let
<i>oldEnv</i> be the running execution context’s
<a href="x10.html#x10.2">LexicalEnvironment</a>.</p>
</li>
<li><p>
Let
<i>newEnv</i> be the result of calling <a href="x10.html#x10.2.2.3">NewObjectEnvironment</a> passing
<i>obj</i> and <i>oldEnv</i> as the arguments</p>
</li>
<li><p>
Set
the <i>provideThis</i> flag of <i>newEnv</i> to <b>true</b>.</p>
</li>
<li><p>
Set
the running execution context’s <a href="x10.html#x10.2">LexicalEnvironment</a> to <i>newEnv</i>.</p>
</li>
<li><p>
Let
<i>C </i>be the result of evaluating <i>Statement </i>but if an
exception is thrown during the evaluation, let <i>C</i> be (throw,
<i>V</i>, empty), where <i>V</i>
is the exception. (Execution now proceeds as if no exception were
thrown.)</p>