mirror of https://github.com/tc39/test262.git
Remove surface tests for %TypedArray%.prototype.toString
Because Test262 asserts the strict equality of `Array.prototype.toString` and `TypedArray.prototype.toString`, tests for properties of the object do not need to be reproduced in both location. Ref gh-526
This commit is contained in:
parent
c95e673feb
commit
c15079e741
|
@ -1,25 +0,0 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: The length property of toString has the attribute DontEnum
|
||||
es5id: 15.4.4.2_A4.1
|
||||
description: Checking use propertyIsEnumerable, for-in
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if (Array.prototype.toString.propertyIsEnumerable('length') !== false) {
|
||||
$ERROR('#1: Array.prototype.toString.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.toString.propertyIsEnumerable('length')));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
var result = true;
|
||||
for (var p in Array.prototype.toString){
|
||||
if (p === "length") {
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (result !== true) {
|
||||
$ERROR('#2: result = true; for (p in Array.prototype.toString) { if (p === "length") result = false; } result === true;');
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: The length property of toString does not have the attribute DontDelete
|
||||
es5id: 15.4.4.2_A4.2
|
||||
description: Checking use hasOwnProperty, delete
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if (Array.prototype.toString.hasOwnProperty('length') !== true) {
|
||||
$ERROR('#1: Array.prototype.toString.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.toString.hasOwnProperty('length')));
|
||||
}
|
||||
|
||||
delete Array.prototype.toString.length;
|
||||
|
||||
//CHECK#2
|
||||
if (Array.prototype.toString.hasOwnProperty('length') !== false) {
|
||||
$ERROR('#2: delete Array.prototype.toString.length; Array.prototype.toString.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.toString.hasOwnProperty('length')));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (Array.prototype.toString.length === undefined) {
|
||||
$ERROR('#3: delete Array.prototype.toString.length; Array.prototype.toString.length !== undefined');
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: The length property of toString has the attribute ReadOnly
|
||||
es5id: 15.4.4.2_A4.3
|
||||
description: Checking if varying the length property fails
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = Array.prototype.toString.length;
|
||||
verifyNotWritable(Array.prototype.toString, "length", null, Infinity);
|
||||
if (Array.prototype.toString.length !== x) {
|
||||
$ERROR('#1: x = Array.prototype.toString.length; Array.prototype.toString.length = Infinity; Array.prototype.toString.length === x. Actual: ' + (Array.prototype.toString.length));
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: The length property of toString is 0
|
||||
es5id: 15.4.4.2_A4.4
|
||||
description: toString.length === 1
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if (Array.prototype.toString.length !== 0) {
|
||||
$ERROR('#1: Array.prototype.toString.length === 0. Actual: ' + (Array.prototype.toString.length));
|
||||
}
|
19
test/built-ins/TypedArray/prototype/toString/length.js → test/built-ins/Array/prototype/toString/length.js
vendored
Executable file → Normal file
19
test/built-ins/TypedArray/prototype/toString/length.js → test/built-ins/Array/prototype/toString/length.js
vendored
Executable file → Normal file
|
@ -1,12 +1,13 @@
|
|||
// Copyright (C) 2015 André Bargull. All rights reserved.
|
||||
// Copyright (C) 2016 The V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es6id: 22.2.3.28
|
||||
es6id: 22.1.3.27
|
||||
esid: sec-array.prototype.tostring
|
||||
description: >
|
||||
%TypedArray%.prototype.toString.length is 0.
|
||||
Array.prototype.toString.length is 0.
|
||||
info: >
|
||||
%TypedArray%.prototype.toString ( )
|
||||
Array.prototype.toString ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in Function object, including constructors, has a length
|
||||
|
@ -19,11 +20,11 @@ info: >
|
|||
Unless otherwise specified, the length property of a built-in Function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(TypedArray.prototype.toString.length, 0);
|
||||
assert.sameValue(Array.prototype.toString.length, 0);
|
||||
|
||||
verifyNotEnumerable(TypedArray.prototype.toString, "length");
|
||||
verifyNotWritable(TypedArray.prototype.toString, "length");
|
||||
verifyConfigurable(TypedArray.prototype.toString, "length");
|
||||
verifyNotEnumerable(Array.prototype.toString, "length");
|
||||
verifyNotWritable(Array.prototype.toString, "length");
|
||||
verifyConfigurable(Array.prototype.toString, "length");
|
|
@ -1,26 +0,0 @@
|
|||
// Copyright (C) 2015 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es6id: 22.2.3.28
|
||||
description: >
|
||||
%TypedArray%.prototype.toString.name is "toString".
|
||||
info: >
|
||||
%TypedArray%.prototype.toString ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in Function object, including constructors, that is not
|
||||
identified as an anonymous function has a name property whose value
|
||||
is a String.
|
||||
|
||||
Unless otherwise specified, the name property of a built-in Function
|
||||
object, if it exists, has the attributes { [[Writable]]: false,
|
||||
[[Enumerable]]: false, [[Configurable]]: true }.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(TypedArray.prototype.toString.name, "toString");
|
||||
|
||||
verifyNotEnumerable(TypedArray.prototype.toString, "name");
|
||||
verifyNotWritable(TypedArray.prototype.toString, "name");
|
||||
verifyConfigurable(TypedArray.prototype.toString, "name");
|
Loading…
Reference in New Issue