This commit is contained in:
David Fugate 2011-09-24 17:20:55 -07:00
commit 1e314c6e13
11 changed files with 1 additions and 245 deletions

View File

@ -1,28 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.1.1.1_A2_T1;
* @section: 15.1.1.1, 15.5.1, 15.6.1, 15.7.1;
* @assertion: The NaN is not ReadOnly;
* @description: Checking Boolean, Number, String Functions;
* @strict_mode_negative
*/
// CHECK#1
NaN = 1;
if (Boolean(NaN) !== true) {
$ERROR('#1: NaN = 1; Boolean(NaN) === true. Actual: ' + (Boolean(NaN)));
}
// CHECK#2
NaN = true;
if (Number(NaN) !== 1) {
$ERROR('#2: NaN = true; Number(NaN) === 1. Actual: ' + (Number(NaN)));
}
// CHECK#3
NaN = 1;
if (String(NaN) !== "1") {
$ERROR('#3: NaN = 1; String(NaN) === "1". Actual: ' + (String(NaN)));
}

View File

@ -1,15 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.1.1.1_A2_T2;
* @section: 15.1.1.1, 11.4.3;
* @assertion: The NaN is not ReadOnly;
* @description: Checking typeof Operator;
*/
// CHECK#1
NaN = true;
if (typeof(NaN) !== "boolean") {
$ERROR('#1: NaN = true; typeof(NaN) === "boolean". Actual: ' + (typeof(NaN)));
}

View File

@ -1,29 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.1.1.2_A2_T1;
* @section: 15.1.1.2, 15.5.1, 15.6.1, 15.7.1;
* @assertion: The Infinity is not ReadOnly;
* @description: Checking Boolean, Number, String Functions;
* @strict_mode_negative
*/
// CHECK#1
Infinity = 0;
if (Boolean(Infinity) !== false) {
$ERROR('#1: Infinity = 0; Boolean(Infinity) === false. Actual: ' + (Boolean(Infinity)));
}
// CHECK#2
Infinity = false;
if (Number(Infinity) !== 0) {
$ERROR('#2: Infinity = false; Number(Infinity) === 0. Actual: ' + (Number(Infinity)));
}
// CHECK#3
Infinity = 0;
if (String(Infinity) !== "0") {
$ERROR('#3: Infinity = 0; String(Infinity) === "0". Actual: ' + (String(Infinity)));
}

View File

@ -1,28 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.1.1.3_A2_T1;
* @section: 15.1.1.3, 15.5.1, 15.6.1, 15.7.1;
* @assertion: The undefined is not ReadOnly;
* @description: Checking Boolean, Number, String Functions;
* @strict_mode_negative
*/
// CHECK#1
undefined = 1;
if (Boolean(undefined) !== true) {
$ERROR('#1: undefined = 1; Boolean(undefined) === true. Actual: ' + (Boolean(undefined)));
}
// CHECK#2
undefined = true;
if (Number(undefined) !== 1) {
$ERROR('#2: undefined = true; Number(undefined) === 1. Actual: ' + (Number(undefined)));
}
// CHECK#3
undefined = 1;
if (String(undefined) !== "1") {
$ERROR('#3: undefined = 1; String(undefined) === "1". Actual: ' + (String(undefined)));
}

View File

@ -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.
/**
* @name: S15.1.1.3_A2_T2;
* @section: 15.1.1.3, 11.4.3;
* @assertion: The undefined is not ReadOnly;
* @description: Checking typeof Operator;
* @strict_mode_negative
*/
// CHECK#1
undefined = true;
if (typeof(undefined) !== "boolean") {
ERROR('#1: undefined = true; typeof(undefined) === "boolean". Actual: ' + (typeof(undefined)));
}

View File

@ -1,18 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.3.4.2_A1_T1;
* @section: 15.3.4.2;
* @assertion: An implementation-dependent representation of the function is returned. This representation has the syntax of a FunctionDeclaration;
* @description: For testing use Function.prototype.toString() function;
*/
var f = function(x) {
return x*x;
};
//CHECK#1
if (eval(f.toString())(10) !== f(10)) {
$ERROR('#1: An implementation-dependent representation of the function is returned. This representation has the syntax of a FunctionDeclaration');
}

View File

@ -1,19 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.3.4.3_A6_T1;
* @section: 15.3.4.3;
* @assertion: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown;
* @description: argArray is (1,{});
*/
//CHECK#1
try {
Function().apply(1,{});
$FAIL('#1: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown');
} catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#1.1: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown');
}
}

View File

@ -1,19 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.3.4.3_A6_T4;
* @section: 15.3.4.3;
* @assertion: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown;
* @description: argArray is (this,function(){return arguments;});
*/
//CHECK#1
try {
Function().apply(this,function(){return arguments;});
$FAIL('#1: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown');
} catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#1.1: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown');
}
}

View File

@ -1,36 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.4.4.2_A2_T1;
* @section: 15.4.4.2;
* @assertion: The toString function is not generic.
* it throws a TypeError exception if its this value is not an Array object;
* @description: {}.toString = Array.prototype.toString;
*/
var obj = {};
obj.toString = Array.prototype.toString;
//CHECK#1
try {
obj.toString();
$ERROR('#1.1: var obj = {}; obj.toString = Array.prototype.toString; obj.toString() throw TypeError. Actual: ' + (obj.toString()));
} catch(e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#1.2: var obj = {}; obj.toString = Array.prototype.toString; obj.toString() throw TypeError. Actual: ' + (e));
}
}
obj[0] = 1;
obj.length = 1;
//CHECK#2
try {
obj.toString();
$ERROR('#2.1: var obj = {}; obj.toString = Array.prototype.toString; obj[0] = 1; obj.length = 1; obj.toString() throw TypeError. Actual: ' + (obj.toString()));
} catch(e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#2.2: var obj = {}; obj.toString = Array.prototype.toString; obj[0] = 1; obj.length = 1; obj.toString() throw TypeError. Actual: ' + (e));
}
}

View File

@ -1,36 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.4.4.3_A2_T1;
* @section: 15.4.4.3;
* @assertion: The toLocalString function is not generic.
* it throws a TypeError exception if its this value is not an Array object;
* @description: {}.toLocaleString = Array.prototype.toLocaleString;
*/
var obj = {};
obj.toLocaleString = Array.prototype.toLocaleString;
//CHECK#1
try {
obj.toLocaleString();
$ERROR('#1.1: var obj = {}; obj.toLocaleString = Array.prototype.toLocaleString; obj.toLocaleString() throw TypeError. Actual: ' + (obj.toLocaleString()));
} catch(e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#1.2: var obj = {}; obj.toLocaleString = Array.prototype.toLocaleString; obj.toLocaleString() throw TypeError. Actual: ' + (e));
}
}
obj[0] = 1;
obj.length = 1;
//CHECK#2
try {
obj.toLocaleString();
$ERROR('#2.1: var obj = {}; obj.toLocaleString = Array.prototype.toLocaleString; obj[0] = 1; obj.length = 1; obj.toLocaleString() throw TypeError. Actual: ' + (obj.toLocaleString()));
} catch(e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#2.2: var obj = {}; obj.toLocaleString = Array.prototype.toLocaleString; obj[0] = 1; obj.length = 1; obj.toLocaleString() throw TypeError. Actual: ' + (e));
}
}

View File

@ -6,7 +6,7 @@
* @section: 15.4.4.7;
* @assertion: The length property of push has the attribute ReadOnly;
* @description: Checking if varying the length property fails;
* @strict_mode_negative
* @noStrict
*/
//CHECK#1