From 363a7b57d87b72ffd906dfb437774a3cdb9c3bda Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 12 Dec 2012 19:06:19 +0100 Subject: [PATCH] Throw a type error if defaultValue doesn't lead to a primitive type As specified in 8.12.8, we need to throw a type error if calling [[defaultValue]] on an object doesn't convert to a primitive type. Change-Id: I6b5db91a36a21c6037998efb15646d00d49b5d4c Reviewed-by: Simon Hausmann --- qmljs_runtime.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/qmljs_runtime.cpp b/qmljs_runtime.cpp index 4c200b2..55258fd 100644 --- a/qmljs_runtime.cpp +++ b/qmljs_runtime.cpp @@ -509,6 +509,7 @@ Value __qmljs_object_default_value(ExecutionContext *ctx, Value object, int type return r; } + ctx->throwTypeError(); return Value::undefinedValue(); } -- 2.7.4