getPrototypeOf returns null if the object doesn't have a prototype
authorLars Knoll <lars.knoll@digia.com>
Mon, 14 Jan 2013 13:02:40 +0000 (14:02 +0100)
committerSimon Hausmann <simon.hausmann@digia.com>
Mon, 14 Jan 2013 15:31:27 +0000 (16:31 +0100)
Change-Id: I33b63bf19b3b8bb3292f3a2f783228f404ed7cac
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
qv4ecmaobjects.cpp
tests/TestExpectations

index 18e8a55..3090505 100644 (file)
@@ -577,7 +577,8 @@ Value ObjectPrototype::method_getPrototypeOf(ExecutionContext *ctx)
     if (! o.isObject())
         ctx->throwTypeError();
 
-    return Value::fromObject(o.objectValue()->prototype);
+    Object *p = o.objectValue()->prototype;
+    return p ? Value::fromObject(p) : Value::nullValue();
 }
 
 Value ObjectPrototype::method_getOwnPropertyDescriptor(ExecutionContext *ctx)
index 5124cef..4b2db80 100644 (file)
@@ -716,14 +716,7 @@ S15.10.1_A1_T10 failing
 S15.10.1_A1_T11 failing
 15.2.3.12-3-27 failing
 15.2.3.13-2-12 failing
-15.2.3.2-2-12 failing
-15.2.3.2-2-13 failing
-15.2.3.2-2-14 failing
-15.2.3.2-2-15 failing
-15.2.3.2-2-16 failing
-15.2.3.2-2-17 failing
 15.2.3.2-2-18 failing
-15.2.3.2-2-31 failing
 S15.1.3.1_A2.2_T1 failing
 S15.1.3.1_A2.3_T1 failing
 S15.1.3.1_A2.4_T1 failing