test262/test/language/statements/switch/cptn-abrupt-empty.js

25 lines
677 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 13.12.11
description: >
Completion value when case block is empty
info: >
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution contexts LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { }
1. Return NormalCompletion(undefined).
---*/
assert.sameValue(eval('1; switch(null) {}'), undefined);