Replace runTestCase with assert helpers [test/built-ins/Object]

This commit is contained in:
André Bargull 2015-08-11 17:53:40 +02:00
parent 44bc67797e
commit 4f35b40617
91 changed files with 96 additions and 551 deletions

View File

@ -4,12 +4,6 @@
/*---
es5id: 15.2.3.2-0-1
description: Object.getPrototypeOf must exist as a function
includes: [runTestCase.js]
---*/
function testcase() {
if (typeof(Object.getPrototypeOf) === "function") {
return true;
}
}
runTestCase(testcase);
assert.sameValue(typeof(Object.getPrototypeOf), "function", 'typeof(Object.getPrototypeOf)');

View File

@ -4,12 +4,6 @@
/*---
es5id: 15.2.3.2-0-2
description: Object.getPrototypeOf must exist as a function taking 1 parameter
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf.length === 1) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf.length, 1, 'Object.getPrototypeOf.length');

View File

@ -4,10 +4,6 @@
/*---
es5id: 15.2.3.2-1-3
description: Object.getPrototypeOf returns Boolean.prototype if 'O' is a boolean
includes: [runTestCase.js]
---*/
function testcase() {
return Object.getPrototypeOf(true) === Boolean.prototype;
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(true), Boolean.prototype, 'Object.getPrototypeOf(true)');

View File

@ -4,10 +4,6 @@
/*---
es5id: 15.2.3.2-1-4
description: Object.getPrototypeOf returns String.prototype if 'O' is a string
includes: [runTestCase.js]
---*/
function testcase() {
return Object.getPrototypeOf("abc") === String.prototype;
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf("abc"), String.prototype, 'Object.getPrototypeOf("abc")');

View File

@ -4,10 +4,6 @@
/*---
es5id: 15.2.3.2-1
description: Object.getPrototypeOf returns Number.prototype if 'O' is a number
includes: [runTestCase.js]
---*/
function testcase() {
return Object.getPrototypeOf(0) === Number.prototype;
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(0), Number.prototype, 'Object.getPrototypeOf(0)');

View File

@ -6,12 +6,6 @@ es5id: 15.2.3.2-2-1
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(Boolean)
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(Boolean) === Function.prototype) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(Boolean), Function.prototype, 'Object.getPrototypeOf(Boolean)');

View File

@ -6,12 +6,6 @@ es5id: 15.2.3.2-2-10
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(RegExp)
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(RegExp) === Function.prototype) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(RegExp), Function.prototype, 'Object.getPrototypeOf(RegExp)');

View File

@ -6,12 +6,6 @@ es5id: 15.2.3.2-2-11
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(Error)
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(Error) === Function.prototype) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(Error), Function.prototype, 'Object.getPrototypeOf(Error)');

View File

@ -6,12 +6,6 @@ es5id: 15.2.3.2-2-12
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(EvalError)
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(EvalError) === Error) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(EvalError), Error, 'Object.getPrototypeOf(EvalError)');

View File

@ -6,12 +6,6 @@ es5id: 15.2.3.2-2-13
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(RangeError)
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(RangeError) === Error) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(RangeError), Error, 'Object.getPrototypeOf(RangeError)');

View File

@ -6,12 +6,6 @@ es5id: 15.2.3.2-2-14
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(ReferenceError)
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(ReferenceError) === Error) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(ReferenceError), Error, 'Object.getPrototypeOf(ReferenceError)');

View File

@ -6,12 +6,6 @@ es5id: 15.2.3.2-2-15
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(SyntaxError)
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(SyntaxError) === Error) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(SyntaxError), Error, 'Object.getPrototypeOf(SyntaxError)');

View File

@ -6,12 +6,6 @@ es5id: 15.2.3.2-2-16
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(TypeError)
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(TypeError) === Error) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(TypeError), Error, 'Object.getPrototypeOf(TypeError)');

View File

@ -6,12 +6,6 @@ es5id: 15.2.3.2-2-17
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(URIError)
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(URIError) === Error) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(URIError), Error, 'Object.getPrototypeOf(URIError)');

View File

@ -6,12 +6,6 @@ es5id: 15.2.3.2-2-18
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(JSON)
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(JSON) === Object.prototype) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(JSON), Object.prototype, 'Object.getPrototypeOf(JSON)');

View File

@ -6,12 +6,8 @@ es5id: 15.2.3.2-2-19
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(Object object)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
return Object.getPrototypeOf(obj) === Object.prototype;
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(obj), Object.prototype, 'Object.getPrototypeOf(obj)');

View File

@ -9,10 +9,8 @@ es5id: 15.2.3.2-2-2
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(custom object)
includes: [runTestCase.js]
---*/
function testcase() {
function base() {}
function derived() {}
@ -20,8 +18,5 @@ function testcase() {
var d = new derived();
var x = Object.getPrototypeOf(d);
if (x.isPrototypeOf(d) === true) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(x.isPrototypeOf(d), true, 'x.isPrototypeOf(d)');

View File

@ -6,14 +6,10 @@ es5id: 15.2.3.2-2-20
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(Function Object)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = function (a, b) {
return a + b;
};
return Object.getPrototypeOf(obj) === Function.prototype;
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(obj), Function.prototype, 'Object.getPrototypeOf(obj)');

View File

@ -6,12 +6,8 @@ es5id: 15.2.3.2-2-21
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(Array object)
includes: [runTestCase.js]
---*/
function testcase() {
var arr = [1, 2, 3];
return Object.getPrototypeOf(arr) === Array.prototype;
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(arr), Array.prototype, 'Object.getPrototypeOf(arr)');

View File

@ -6,12 +6,8 @@ es5id: 15.2.3.2-2-22
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(String object)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = new String("abc");
return Object.getPrototypeOf(obj) === String.prototype;
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(obj), String.prototype, 'Object.getPrototypeOf(obj)');

View File

@ -6,12 +6,8 @@ es5id: 15.2.3.2-2-23
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(Boolean object)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = new Boolean(true);
return Object.getPrototypeOf(obj) === Boolean.prototype;
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(obj), Boolean.prototype, 'Object.getPrototypeOf(obj)');

View File

@ -6,12 +6,8 @@ es5id: 15.2.3.2-2-24
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(Number object)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = new Number(-3);
return Object.getPrototypeOf(obj) === Number.prototype;
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(obj), Number.prototype, 'Object.getPrototypeOf(obj)');

View File

@ -6,12 +6,8 @@ es5id: 15.2.3.2-2-25
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(Date object)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = new Date();
return Object.getPrototypeOf(obj) === Date.prototype;
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(obj), Date.prototype, 'Object.getPrototypeOf(obj)');

View File

@ -6,12 +6,8 @@ es5id: 15.2.3.2-2-26
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(RegExp object)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = new RegExp();
return Object.getPrototypeOf(obj) === RegExp.prototype;
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(obj), RegExp.prototype, 'Object.getPrototypeOf(obj)');

View File

@ -6,12 +6,8 @@ es5id: 15.2.3.2-2-27
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(Error object)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = new Error();
return Object.getPrototypeOf(obj) === Error.prototype;
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(obj), Error.prototype, 'Object.getPrototypeOf(obj)');

View File

@ -6,15 +6,11 @@ es5id: 15.2.3.2-2-28
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(the Arguments object)
includes: [runTestCase.js]
---*/
function testcase() {
function fun() {
return arguments;
}
var obj = fun(1, true, 3);
return Object.getPrototypeOf(obj) === Object.prototype;
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(obj), Object.prototype, 'Object.getPrototypeOf(obj)');

View File

@ -6,12 +6,6 @@ es5id: 15.2.3.2-2-3
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(Object)
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(Object) === Function.prototype) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(Object), Function.prototype, 'Object.getPrototypeOf(Object)');

View File

@ -6,14 +6,9 @@ es5id: 15.2.3.2-2-30
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(the global object)
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
var proto = Object.getPrototypeOf(fnGlobalObject());
return proto.isPrototypeOf(fnGlobalObject()) === true;
}
runTestCase(testcase);
assert.sameValue(proto.isPrototypeOf(fnGlobalObject()), true, 'proto.isPrototypeOf(fnGlobalObject())');

View File

@ -4,11 +4,6 @@
/*---
es5id: 15.2.3.2-2-31
description: Object.getPrototypeOf returns null
includes: [runTestCase.js]
---*/
function testcase() {
return (Object.getPrototypeOf(Object.prototype) === null);
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(Object.prototype), null, 'Object.getPrototypeOf(Object.prototype)');

View File

@ -6,12 +6,6 @@ es5id: 15.2.3.2-2-4
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(Function)
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(Function) === Function.prototype) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(Function), Function.prototype, 'Object.getPrototypeOf(Function)');

View File

@ -6,12 +6,6 @@ es5id: 15.2.3.2-2-5
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(Array)
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(Array) === Function.prototype) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(Array), Function.prototype, 'Object.getPrototypeOf(Array)');

View File

@ -6,12 +6,6 @@ es5id: 15.2.3.2-2-6
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(String)
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(String) === Function.prototype) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(String), Function.prototype, 'Object.getPrototypeOf(String)');

View File

@ -6,12 +6,6 @@ es5id: 15.2.3.2-2-7
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(Number)
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(Number) === Function.prototype) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(Number), Function.prototype, 'Object.getPrototypeOf(Number)');

View File

@ -6,12 +6,6 @@ es5id: 15.2.3.2-2-8
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(Math)
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(Math) === Object.prototype) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(Math), Object.prototype, 'Object.getPrototypeOf(Math)');

View File

@ -6,12 +6,6 @@ es5id: 15.2.3.2-2-9
description: >
Object.getPrototypeOf returns the [[Prototype]] of its parameter
(Date)
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(Date) === Function.prototype) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(Date), Function.prototype, 'Object.getPrototypeOf(Date)');

View File

@ -6,15 +6,10 @@ es5id: 15.2.3.1
description: >
Object.prototype is a data property with default attribute values
(false)
includes: [runTestCase.js]
---*/
function testcase() {
var desc = Object.getOwnPropertyDescriptor(Object, 'prototype');
if (desc.writable === false &&
desc.enumerable === false &&
desc.configurable === false) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(desc.writable, false, 'desc.writable');
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
assert.sameValue(desc.configurable, false, 'desc.configurable');

View File

@ -4,13 +4,8 @@
/*---
es5id: 8.12.1-1_1
description: Properties - [[HasOwnProperty]] (property does not exist)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_10
description: >
Properties - [[HasOwnProperty]] (writable, configurable,
non-enumerable own value property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {value: 42, writable:true, configurable:true});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_11
description: >
Properties - [[HasOwnProperty]] (writable, configurable,
enumerable own value property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {value: 42, writable:true, enumerable:true, configurable:true});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_12
description: >
Properties - [[HasOwnProperty]] (non-writable, non-configurable,
non-enumerable inherited value property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {value: 42});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_13
description: >
Properties - [[HasOwnProperty]] (non-writable, non-configurable,
enumerable inherited value property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {value: 42, enumerable:true});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_14
description: >
Properties - [[HasOwnProperty]] (non-writable, configurable,
non-enumerable inherited value property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {value: 42, configurable:true});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_15
description: >
Properties - [[HasOwnProperty]] (writable, non-configurable,
non-enumerable inherited value property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {value: 42, writable:true});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_16
description: >
Properties - [[HasOwnProperty]] (non-writable, configurable,
enumerable inherited value property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {value: 42, configurable:true, enumerable:true});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_17
description: >
Properties - [[HasOwnProperty]] (writable, non-configurable,
enumerable inherited value property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {value: 42, writable:true, enumerable:true});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_18
description: >
Properties - [[HasOwnProperty]] (writable, configurable,
non-enumerable inherited value property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {value: 42, writable:true, configurable:true});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_19
description: >
Properties - [[HasOwnProperty]] (writable, configurable,
enumerable inherited value property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {value: 42, writable:true, enumerable:true, configurable:true});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -4,13 +4,8 @@
/*---
es5id: 8.12.1-1_2
description: Properties - [[HasOwnProperty]] (old style own property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {foo: 42};
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -4,13 +4,8 @@
/*---
es5id: 8.12.1-1_20
description: Properties - [[HasOwnProperty]] (literal own getter property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = { get foo() { return 42;} };
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -4,13 +4,8 @@
/*---
es5id: 8.12.1-1_21
description: Properties - [[HasOwnProperty]] (literal own setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = { set foo(x) {;} };
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,13 +6,8 @@ es5id: 8.12.1-1_22
description: >
Properties - [[HasOwnProperty]] (literal own getter/setter
property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = { get foo() { return 42;}, set foo(x) {;} };
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -4,14 +4,9 @@
/*---
es5id: 8.12.1-1_23
description: Properties - [[HasOwnProperty]] (literal inherited getter property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = { get foo() { return 42;} };
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -4,14 +4,9 @@
/*---
es5id: 8.12.1-1_24
description: Properties - [[HasOwnProperty]] (literal inherited setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = { set foo(x) {;} };
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_25
description: >
Properties - [[HasOwnProperty]] (literal inherited getter/setter
property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = { get foo() { return 42;}, set foo(x) {;} };
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_26
description: >
Properties - [[HasOwnProperty]] (non-configurable, non-enumerable
own getter property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {get: function() {return 42;}});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_27
description: >
Properties - [[HasOwnProperty]] (non-configurable, enumerable own
getter property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {get: function() {return 42;}, enumerable:true});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_28
description: >
Properties - [[HasOwnProperty]] (configurable, non-enumerable own
getter property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {get: function() {return 42;}, configurable:true});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_29
description: >
Properties - [[HasOwnProperty]] (configurable, enumerable own
getter property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {get: function() {return 42;}, enumerable:true, configurable:true});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -4,14 +4,9 @@
/*---
es5id: 8.12.1-1_3
description: Properties - [[HasOwnProperty]] (old style inherited property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {foo:42};
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_30
description: >
Properties - [[HasOwnProperty]] (non-configurable, non-enumerable
own setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {set: function() {;}});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_31
description: >
Properties - [[HasOwnProperty]] (non-configurable, enumerable own
setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {set: function() {;}, enumerable:true});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_32
description: >
Properties - [[HasOwnProperty]] (configurable, non-enumerable own
setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {set: function() {;}, configurable:true});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_33
description: >
Properties - [[HasOwnProperty]] (configurable, enumerable own
setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {set: function() {;}, enumerable:true, configurable:true});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_34
description: >
Properties - [[HasOwnProperty]] (non-configurable, non-enumerable
own getter/setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {get: function() {return 42;}, set: function() {;}});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_35
description: >
Properties - [[HasOwnProperty]] (non-configurable, enumerable own
getter/setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {get: function() {return 42;}, set: function() {;}, enumerable:true});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_36
description: >
Properties - [[HasOwnProperty]] (configurable, non-enumerable own
getter/setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {get: function() {return 42;}, set: function() {;}, configurable:true});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_37
description: >
Properties - [[HasOwnProperty]] (configurable, enumerable own
getter/setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {get: function() {return 42;}, set: function() {;}, enumerable:true, configurable:true});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_38
description: >
Properties - [[HasOwnProperty]] (non-configurable, non-enumerable
inherited getter property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {get: function() {return 42;}});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_39
description: >
Properties - [[HasOwnProperty]] (non-configurable, enumerable
inherited getter property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {get: function() {return 42;}, enumerable:true});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_4
description: >
Properties - [[HasOwnProperty]] (non-writable, non-configurable,
non-enumerable own value property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {value: 42});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_40
description: >
Properties - [[HasOwnProperty]] (configurable, non-enumerable
inherited getter property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {get: function() {return 42;}, configurable:true});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_41
description: >
Properties - [[HasOwnProperty]] (configurable, enumerable
inherited getter property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {get: function() {return 42;}, enumerable:true, configurable:true});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_42
description: >
Properties - [[HasOwnProperty]] (non-configurable, non-enumerable
inherited setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {set: function() {;}});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_43
description: >
Properties - [[HasOwnProperty]] (non-configurable, enumerable
inherited setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {set: function() {;}, enumerable:true});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_44
description: >
Properties - [[HasOwnProperty]] (configurable, non-enumerable
inherited setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {set: function() {;}, configurable:true});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_45
description: >
Properties - [[HasOwnProperty]] (configurable, enumerable
inherited setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {set: function() {;}, enumerable:true, configurable:true});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_46
description: >
Properties - [[HasOwnProperty]] (non-configurable, non-enumerable
inherited getter/setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {get: function() {return 42;}, set: function() {;}});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_47
description: >
Properties - [[HasOwnProperty]] (non-configurable, enumerable
inherited getter/setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {get: function() {return 42;}, set: function() {;}, enumerable:true});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_48
description: >
Properties - [[HasOwnProperty]] (configurable, non-enumerable
inherited getter/setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {get: function() {return 42;}, set: function() {;}, configurable:true});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,15 +6,10 @@ es5id: 8.12.1-1_49
description: >
Properties - [[HasOwnProperty]] (configurable, enumerable
inherited getter/setter property)
includes: [runTestCase.js]
---*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {get: function() {return 42;}, set: function() {;}, enumerable:true, configurable:true});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_5
description: >
Properties - [[HasOwnProperty]] (non-writable, non-configurable,
enumerable own value property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {value: 42, enumerable:true});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_6
description: >
Properties - [[HasOwnProperty]] (non-writable, configurable,
non-enumerable own value property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {value: 42, configurable:true});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_7
description: >
Properties - [[HasOwnProperty]] (writable, non-configurable,
non-enumerable own value property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {value: 42, writable:true});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_8
description: >
Properties - [[HasOwnProperty]] (non-writable, configurable,
enumerable own value property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {value: 42, configurable:true, enumerable:true});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,14 +6,9 @@ es5id: 8.12.1-1_9
description: >
Properties - [[HasOwnProperty]] (writable, non-configurable,
enumerable own value property)
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {value: 42, writable:true, enumerable:true});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true');

View File

@ -6,10 +6,6 @@ es5id: 15.2.4.2-1-1
description: >
Object.prototype.toString - '[object Undefined]' will be returned
when 'this' value is undefined
includes: [runTestCase.js]
---*/
function testcase() {
return Object.prototype.toString.call(undefined) === "[object Undefined]";
}
runTestCase(testcase);
assert.sameValue(Object.prototype.toString.call(undefined), "[object Undefined]", 'Object.prototype.toString.call(undefined)');

View File

@ -6,10 +6,6 @@ es5id: 15.2.4.2-1-2
description: >
Object.prototype.toString - '[object Undefined]' will be returned
when 'this' value is undefined
includes: [runTestCase.js]
---*/
function testcase() {
return Object.prototype.toString.apply(undefined, []) === "[object Undefined]";
}
runTestCase(testcase);
assert.sameValue(Object.prototype.toString.apply(undefined, []), "[object Undefined]", 'Object.prototype.toString.apply(undefined, [])');

View File

@ -6,10 +6,6 @@ es5id: 15.2.4.2-2-1
description: >
Object.prototype.toString - '[object Null]' will be returned when
'this' value is null
includes: [runTestCase.js]
---*/
function testcase() {
return Object.prototype.toString.call(null) === "[object Null]";
}
runTestCase(testcase);
assert.sameValue(Object.prototype.toString.call(null), "[object Null]", 'Object.prototype.toString.call(null)');

View File

@ -6,10 +6,6 @@ es5id: 15.2.4.2-2-2
description: >
Object.prototype.toString - '[object Null]' will be returned when
'this' value is null
includes: [runTestCase.js]
---*/
function testcase() {
return Object.prototype.toString.apply(null, []) === "[object Null]";
}
runTestCase(testcase);
assert.sameValue(Object.prototype.toString.apply(null, []), "[object Null]", 'Object.prototype.toString.apply(null, [])');

View File

@ -6,10 +6,6 @@ es5id: 15.2.4.4-1
description: >
Object.prototype.valueOf - typeof
Object.prototype.valueOf.call(true)==="object"
includes: [runTestCase.js]
---*/
function testcase() {
return (typeof Object.prototype.valueOf.call(true)) === "object";
}
runTestCase(testcase);
assert.sameValue(typeof Object.prototype.valueOf.call(true), "object", 'typeof Object.prototype.valueOf.call(true)');

View File

@ -6,10 +6,6 @@ es5id: 15.2.4.4-2
description: >
Object.prototype.valueOf - typeof
Object.prototype.valueOf.call(false)==="object"
includes: [runTestCase.js]
---*/
function testcase() {
return (typeof Object.prototype.valueOf.call(false)) === "object";
}
runTestCase(testcase);
assert.sameValue(typeof Object.prototype.valueOf.call(false), "object", 'typeof Object.prototype.valueOf.call(false)');