Fix the Object.getPrototypeOf function.
Related issue: #208 JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
This commit is contained in:
@@ -128,8 +128,7 @@ try {
|
||||
// Create an object with null as prototype
|
||||
var obj = Object.create(null)
|
||||
assert (typeof (obj) === "object");
|
||||
// FIXME: enable this assertion after the #208 is fixed.
|
||||
// assert (Object.getPrototypeOf (obj) === null);
|
||||
assert (Object.getPrototypeOf (obj) === null);
|
||||
|
||||
try {
|
||||
Object.create()
|
||||
|
||||
@@ -35,11 +35,21 @@ try {
|
||||
assert (e instanceof TypeError);
|
||||
}
|
||||
|
||||
try {
|
||||
var y = Object.getPrototypeOf(null);
|
||||
assert (false);
|
||||
} catch (e) {
|
||||
assert (e instanceof TypeError);
|
||||
}
|
||||
|
||||
var obj = { x : "foo" };
|
||||
assert (Object.getPrototypeOf(obj) === Object.prototype)
|
||||
assert (Object.getPrototypeOf(obj) === Object.prototype);
|
||||
|
||||
var constructor = function () {};
|
||||
constructor.prototype = obj;
|
||||
|
||||
var d_obj = new constructor();
|
||||
assert (Object.getPrototypeOf(d_obj) === obj);
|
||||
|
||||
obj = Object.create(null);
|
||||
assert (Object.getPrototypeOf(obj) === null);
|
||||
|
||||
Reference in New Issue
Block a user