From cfc60b039c02ed10de5a210c5e23d95426e113fc Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 14 Jan 2013 17:11:03 +0100 Subject: [PATCH] Fix a corner case in Object.create() Change-Id: Ie1c32178793b44c2d14630b849622bffc4a09d26 Reviewed-by: Simon Hausmann --- qv4ecmaobjects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qv4ecmaobjects.cpp b/qv4ecmaobjects.cpp index 99aeb21..fa1b398 100644 --- a/qv4ecmaobjects.cpp +++ b/qv4ecmaobjects.cpp @@ -620,7 +620,7 @@ Value ObjectPrototype::method_create(ExecutionContext *ctx) newObject->prototype = O.objectValue(); Value objValue = Value::fromObject(newObject); - if (ctx->argumentCount > 1) { + if (ctx->argumentCount > 1 && !ctx->argument(1).isUndefined()) { ctx->arguments[0] = objValue; method_defineProperties(ctx); } -- 2.7.4