Debian Codegraph @

js/src/tests/test262/language/statements/with/cptn-abrupt-empty.js

raw
1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-with-statement-runtime-semantics-evaluation
5 description: >
6 Statement completion value when body returns an empty abrupt completion
7 info: |
8 WithStatement : with ( Expression ) Statement
9
10 [...]
11 7. Let C be the result of evaluating Statement.
12 8. Set the running execution context's LexicalEnvironment to oldEnv.
13 9. Return Completion(UpdateEmpty(C, undefined)).
14 flags: [noStrict]
15 ---*/
16
17 assert.sameValue(
18 eval('1; do { 2; with({}) { 3; break; } 4; } while (false);'), 3
19 );
20 assert.sameValue(
21 eval('5; do { 6; with({}) { break; } 7; } while (false);'), undefined
22 );
23
24 assert.sameValue(
25 eval('8; do { 9; with({}) { 10; continue; } 11; } while (false)'), 10
26 );
27 assert.sameValue(
28 eval('12; do { 13; with({}) { continue; } 14; } while (false)'), undefined
29 );
30
31 reportCompare(0, 0);