mirror of
				https://github.com/tc39/test262.git
				synced 2025-11-04 05:33:50 +01:00 
			
		
		
		
	- in-statement-position-label-statement.js is an Annex-B test (B.3.2 Labelled Function Declarations), moved to annexB directory - identifier-let-allowed-as-lefthandside-expression-strict.js needs to check for a SyntaxError (ES6, 12.1.1) - Remove sort() calls in test/built-ins/Object/getOwnPropertyNames/*.js - Remove sort() calls in test/language/block-scope/syntax/for-in/acquire-properties-from-*.js - verifyConfigurable() needs to called last in test/built-ins/Object/is/length.js - All productions within ClassBody are implicitly strict, update test/language/class/method-definition/yield-as-*.js accordingly - Remove unnecessary noStrict flag in test/language/class/method-definition/yield-as-generator-method-binding-identifier.js - Check own symbols are returned in property creation order from Object.getOwnPropertySymbols(): - test/language/computed-property-names/basics/symbol.js - test/language/computed-property-names/class/method/symbol.js - test/language/computed-property-names/class/static/method-symbol.js - test/language/computed-property-names/object/method/symbol.js - Fix copy-paste error in test/language/expressions/object/method-definition/yield-as-function-expression-binding-identifier.js
		
			
				
	
	
		
			27 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
// Copyright (C) 2014 the V8 project authors. All rights reserved.
 | 
						|
// This code is governed by the BSD license found in the LICENSE file.
 | 
						|
/*---
 | 
						|
es6id: 12.2.5
 | 
						|
description: >
 | 
						|
    In a class, static computed property method names can be a number
 | 
						|
includes: [compareArray.js]
 | 
						|
---*/
 | 
						|
class C {
 | 
						|
  static a() { return 'A'; }
 | 
						|
  static [1]() { return 'B'; }
 | 
						|
  static c() { return 'C'; }
 | 
						|
  static [2]() { return 'D'; }
 | 
						|
}
 | 
						|
assert.sameValue(C.a(), 'A', "`C.a()` returns `'A'`. Defined as `static a() { return 'A'; }`");
 | 
						|
assert.sameValue(C[1](), 'B', "`C[1]()` returns `'B'`. Defined as `static [1]() { return 'B'; }`");
 | 
						|
assert.sameValue(C.c(), 'C', "`C.c()` returns `'C'`. Defined as `static c() { return 'C'; }`");
 | 
						|
assert.sameValue(C[2](), 'D', "`C[2]()` returns `'D'`. Defined as `static [2]() { return 'D'; }`");
 | 
						|
assert(
 | 
						|
  compareArray(Object.keys(C), []),
 | 
						|
  "`compareArray(Object.keys(C), [])` returns `true`"
 | 
						|
);
 | 
						|
assert(
 | 
						|
  compareArray(Object.getOwnPropertyNames(C), ['1', '2', 'length', 'prototype', 'a', 'c', 'name']),
 | 
						|
  "`compareArray(Object.getOwnPropertyNames(C), ['1', '2', 'length', 'prototype', 'a', 'c', 'name'])` returns `true`"
 | 
						|
);
 |