Skip to content
Snippets Groups Projects
Commit 02e7fb9c authored by Mark Miller's avatar Mark Miller
Browse files

Updating Google's contribution to r95 of Sputnik tests.

parent bcc15fd5
No related branches found
No related tags found
No related merge requests found
Showing
with 115 additions and 46 deletions
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.2.4.4_A13;
* @section: 15.2.4.4;
* @assertion: Let O be the result of calling ToObject passing the this
* value as the argument.
* @negative
*/
Object.prototype.toLocaleString.call(null);
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.2.4.5_A12;
* @section: 15.2.4.5;
* @assertion: Let O be the result of calling ToObject passing the this
* value as the argument.
* @negative
*/
Object.prototype.hasOwnProperty.call(undefined, 'foo');
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.2.4.5_A13;
* @section: 15.2.4.5;
* @assertion: Let O be the result of calling ToObject passing the this
* value as the argument.
* @negative
*/
Object.prototype.hasOwnProperty.call(null, 'foo');
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.2.4.6_A12;
* @section: 15.2.4.6;
* @assertion: Let O be the result of calling ToObject passing the this
* value as the argument.
* @negative
*/
Object.prototype.isPrototypeOf.call(undefined, {});
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.2.4.6_A13;
* @section: 15.2.4.6;
* @assertion: Let O be the result of calling ToObject passing the this
* value as the argument.
* @negative
*/
Object.prototype.isPrototypeOf.call(null, {});
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.2.4.7_A12;
* @section: 15.2.4.7;
* @assertion: Let O be the result of calling ToObject passing the this
* value as the argument.
* @negative
*/
Object.prototype.propertyIsEnumerable.call(undefined, 'foo');
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.2.4.7_A13;
* @section: 15.2.4.7;
* @assertion: Let O be the result of calling ToObject passing the this
* value as the argument.
* @negative
*/
Object.prototype.propertyIsEnumerable.call(null, 'foo');
......@@ -4,14 +4,12 @@
/**
* @name: S15.3.4_A1;
* @section: 15.3.4;
* @assertion: The Function prototype object is itself a Function object (its [[Class]] is "Function");
* @description: first we delete Function.prototype.toString cause it overrides Object prototype toString.
* Object.prototype.toString returns [object+[[class]]+];
* @assertion: The Function prototype object is itself a Function
* object (its [[Class]] is "Function");
* @description: Object.prototype.toString returns [object+[[Class]]+];
*/
delete Function.prototype.toString;
//CHECK#1
if (Function.prototype.toString() !== "[object "+"Function"+"]") {
$ERROR('#1: The Function prototype object is itself a Function object (its [[Class]] is "Function")');
if (Object.prototype.toString.call(Function.prototype) !== "[object Function]") {
$ERROR('#2: The Function prototype object is itself a Function ' +
'object (its [[Class]] is "Function") (15.3.4)');
}
......@@ -3,19 +3,15 @@
/**
* @name: S15.3.4_A3_T1;
* @section: 15.3.4, 15.3.2.1;
* @assertion: The value of the internal [[Prototype]] property of the Function prototype object is the Object prototype object (15.3.2.1);
* @section: 15.3.4;
* @assertion: The value of the internal [[Prototype]] property of the
* Function prototype object is the Object prototype object
* (15.3.4);
* @description: Checking prototype of Function.prototype;
*/
//CHECK#1
if (!(Object.prototype.isPrototypeOf(Function.prototype))) {
$ERROR('#1: The value of the internal [[Prototype]] property of the Function prototype object is the Object prototype object (15.3.2.1)');
}
delete Function.prototype.toString;
//CHECK#2
if (Function.prototype.toString() !== "[object "+"Function"+"]") {
$ERROR('#2: The value of the internal [[Prototype]] property of the Function prototype object is the Object prototype object (15.3.2.1)');
if (Object.getPrototypeOf(Function.prototype) !== Object.prototype) {
$ERROR('#1: The value of the internal [[Prototype]] property of ' +
'the Function prototype object is the Object prototype ' +
'object (15.3.4)');
}
......@@ -4,7 +4,9 @@
/**
* @name: S15.3.5.1_A1_T1;
* @section: 15.3.5.1;
* @assertion: The value of the length property is usually an integer that indicates the 'typical' number of arguments expected by the function;
* @assertion: The value of the length property is usually an integer
* that indicates the 'typical' number of arguments
* expected by the function;
* @description: Checking length property of Function("arg1,arg2,arg3", null);
*/
......
......@@ -4,17 +4,12 @@
/**
* @name: S15.3.5_A1_T1;
* @section: 15.3.5;
* @assertion: The value of the [[Class]] property is "Function" ;
* @description: We delete Function.prototype.toString method to access Object.prototype.toString method.
* For testing use variable f = new Function;
* @assertion: The value of the [[Class]] property is "Function";
* @description: For testing use variable f = new Function;
*/
f = new Function;
var f = new Function;
delete Function.prototype.toString;
//CHECK#1
if (f.toString() !== "[object "+"Function"+"]") {
if (Object.prototype.toString.call(f) !== "[object Function]") {
$ERROR('#1: The value of the [[Class]] property is "Function"');
}
......@@ -5,16 +5,12 @@
* @name: S15.3.5_A1_T2;
* @section: 15.3.5;
* @assertion: The value of the [[Class]] property is "Function" ;
* @description: We delete Function.prototype.toString method to access Object.prototype.toString method
* For testing use variable f = Function();
* @description: For testing use variable f = Function();
*/
f = Function();
var f = Function();
delete Function.prototype.toString;
//CHECK#1
if (f.toString() !== "[object "+"Function"+"]") {
if (Object.prototype.toString.call(f) !== "[object Function]") {
$ERROR('#1: The value of the [[Class]] property is "Function"');
}
......@@ -3,15 +3,13 @@
/**
* @name: S15.4.4_A1.1_T2;
* @section: 15.4.4, 11.4.1;
* @assertion: The value of the internal [[Prototype]] property of
* the Array prototype object is the Object prototype object;
* @description: delete Array.prototype.toString;
* @strict_mode_negative
* @section: 15.4.4;
* @assertion:The Array prototype object is itself an array; its
* [[Class]] is "Array",
*/
//CHECK#1
delete Array.prototype.toString;
if (Array.prototype.toString() !== "[object " + "Array" + "]") {
$ERROR('#1: delete Array.prototype.toString; var Array.prototype = Object(); Array.prototype.toString() === "[object " + "Array" + "]". Actual: ' + (Array.prototype.toString()));
if (Object.prototype.toString.call(Array.prototype) !== "[object Array]") {
$ERROR('The Array prototype object is itself an array; its' +
'[[Class]] is "Array".');
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment