mirror of
				https://github.com/tc39/test262.git
				synced 2025-11-03 21:24:30 +01:00 
			
		
		
		
	The project contains tests for the completion value of most (but not all) statements. Introduce tests to complete coverage of this detail.
		
			
				
	
	
		
			20 lines
		
	
	
		
			793 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			793 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
// Copyright (C) 2016 the V8 project authors. All rights reserved.
 | 
						|
// This code is governed by the BSD license found in the LICENSE file.
 | 
						|
/*---
 | 
						|
esid: sec-labelled-statements-runtime-semantics-labelledevaluation
 | 
						|
es6id: 13.13.14
 | 
						|
description: Completion value when LabelledItem returns a "break" completion
 | 
						|
info: |
 | 
						|
  LabelledStatement : LabelIdentifier : LabelledItem
 | 
						|
 | 
						|
  1. Let label be the StringValue of LabelIdentifier.
 | 
						|
  2. Append label as an element of labelSet.
 | 
						|
  3. Let stmtResult be LabelledEvaluation of LabelledItem with argument
 | 
						|
     labelSet.
 | 
						|
  4. If stmtResult.[[Type]] is break and SameValue(stmtResult.[[Target]],
 | 
						|
     label) is true, then
 | 
						|
     a. Let stmtResult be NormalCompletion(stmtResult.[[Value]]).
 | 
						|
---*/
 | 
						|
 | 
						|
assert.sameValue(eval('test262id: { 5; break test262id; 9; }'), 5);
 |