mirror of
https://github.com/tc39/test262.git
synced 2025-05-10 09:50:30 +02:00
- Add missing "var" declarations and noStrict flags - Move code which requires non-strict semantics from Array.prototype.find_this-arg.js to Array.prototype.find_this-arg-receiver-primitive.js - Remove duplicate code from Array.prototype.findIndex_this-arg.js, already present in Array.prototype.findIndex_this-arg-receiver-primitive.js - Remove test code from Array.of_assignment-to-new-object-length.js, does not work in strict mode Part of issue #35
18 lines
662 B
JavaScript
18 lines
662 B
JavaScript
// Copyright (c) 2014 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
/*---
|
|
es6id: 22.1.2.3
|
|
description: >
|
|
The Array.of() method creates a new Array instance
|
|
with a variable number of arguments, regardless of
|
|
number or type of the arguments.
|
|
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/of
|
|
includes: [compareArray.js]
|
|
---*/
|
|
function Empty() {}
|
|
Empty.of = Array.of;
|
|
Object.defineProperty(Empty.prototype, "length", {get: function() { return 0; }});
|
|
|
|
assert.throws(TypeError, function() { Empty.of(); });
|