Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Commit fd9d387

Browse files
committed
Proper Object.create shim for tests
1 parent ec7f033 commit fd9d387

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+285
-57
lines changed

tests/build-pages.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ var LIBS = {
4646
obj[name] = desc.value;
4747
},
4848

49-
'Object.create': function () { return {}; },
49+
'Object.create': function (o) {
50+
function F() {}
51+
F.prototype = o;
52+
return new F();
53+
},
5054
'Object.getPrototypeOf': function (obj) { return obj.constructor.prototype; },
5155
'Object.isExtensible' : function () { return true; },
5256
'Object.getOwnPropertyNames': function (obj) {

tests/test262/pages/ch06/6.2/6.2.2_a.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch06/6.2/6.2.2_b.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch06/6.2/6.2.2_c.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch06/6.2/6.2.3.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch06/6.2/6.2.4.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch09/9.1/9.1_a.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch09/9.1/9.1_b.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch09/9.2/9.2.1_1.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch09/9.2/9.2.1_2.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch09/9.2/9.2.1_3.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch09/9.2/9.2.1_4.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch09/9.2/9.2.1_8_c_ii.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch09/9.2/9.2.1_8_c_vi.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch09/9.2/9.2.2.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch09/9.2/9.2.3_5.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch09/9.2/9.2.5_6.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch09/9.2/9.2.6_2.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch09/9.2/9.2.6_4.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch09/9.2/9.2.6_4_b.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch09/9.2/9.2.6_4_c.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch09/9.2/9.2.8_1_c.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch09/9.2/9.2.8_4.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.isExtensible = Object.isExtensible || function () { return true; };
1317
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1418
var ret = [];

tests/test262/pages/ch11/11.1/11.1.1_1.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch11/11.1/11.1.1_15.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch11/11.1/11.1.1_21.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch11/11.1/11.1.1_34.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch11/11.1/11.1.1_6.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch11/11.1/11.1.1_7.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

tests/test262/pages/ch11/11.1/11.1.1_a.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
if (desc.hasOwnProperty('value'))
99
obj[name] = desc.value;
1010
} }
11-
Object.create = Object.create || function () { return {}; };
11+
Object.create = Object.create || function (o) {
12+
function F() {}
13+
F.prototype = o;
14+
return new F();
15+
};
1216
Object.getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
1317
var ret = [];
1418

0 commit comments

Comments
 (0)