mirror of
https://github.com/tc39/test262.git
synced 2025-07-12 08:34:41 +02: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
23 lines
654 B
JavaScript
23 lines
654 B
JavaScript
// Copyright (C) 2011 the V8 project authors. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
/*---
|
|
es6id: 13.1
|
|
description: >
|
|
for-in to acquire properties from array
|
|
includes: [arrayContains.js]
|
|
---*/
|
|
function props(x) {
|
|
var array = [];
|
|
for (let p in x) array.push(p);
|
|
return array;
|
|
}
|
|
|
|
assert.sameValue(props([]).length, 0);
|
|
assert.sameValue(props([1]).length, 1);
|
|
assert.sameValue(props([1,2]).length, 2);
|
|
assert.sameValue(props([1,2,3]).length, 3);
|
|
|
|
assert(arrayContains(props([1]), ["0"]));
|
|
assert(arrayContains(props([1,2]), ["0", "1"]));
|
|
assert(arrayContains(props([1,2,3]), ["0", "1", "2"]));
|