Jeff Smith : jscript: Set return object's class to 'object' in Object.create.

Alexandre Julliard julliard at winehq.org
Fri Aug 7 10:42:27 CDT 2020


Module: wine
Branch: stable
Commit: fe46ebb9e117c479f7231d00100a52c201c2247f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=fe46ebb9e117c479f7231d00100a52c201c2247f

Author: Jeff Smith <whydoubt at gmail.com>
Date:   Mon Mar 16 23:36:37 2020 -0500

jscript: Set return object's class to 'object' in Object.create.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48762
Signed-off-by: Jeff Smith <whydoubt at gmail.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit dd678df78911124791fa6fcad9e6a2aeedaeed36)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/jscript/object.c    | 2 +-
 dlls/mshtml/tests/es5.js | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/jscript/object.c b/dlls/jscript/object.c
index 58db45b861..0331f5fbd4 100644
--- a/dlls/jscript/object.c
+++ b/dlls/jscript/object.c
@@ -612,7 +612,7 @@ static HRESULT Object_create(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
         return E_INVALIDARG;
     }
 
-    hres = create_dispex(ctx, NULL, proto, &obj);
+    hres = create_dispex(ctx, &ObjectInst_info, proto, &obj);
     if(FAILED(hres))
         return hres;
 
diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js
index 7a5b9d57ea..6b5d04a959 100644
--- a/dlls/mshtml/tests/es5.js
+++ b/dlls/mshtml/tests/es5.js
@@ -768,7 +768,7 @@ function test_getPrototypeOf() {
 }
 
 function test_toString() {
-    var tmp;
+    var tmp, obj;
 
     (function () { tmp = Object.prototype.toString.call(arguments); })();
     todo_wine.
@@ -786,6 +786,13 @@ function test_toString() {
     todo_wine.
     ok(tmp === "[object Undefined]", "toString.call() = " + tmp);
 
+    obj = Object.create(null);
+    tmp = Object.prototype.toString.call(obj);
+    ok(tmp === "[object Object]", "toString.call(Object.create(null)) = " + tmp);
+    obj = Object.create(Number.prototype);
+    tmp = Object.prototype.toString.call(obj);
+    ok(tmp === "[object Object]", "toString.call(Object.create(Number.prototype)) = " + tmp);
+
     next_test();
 }
 




More information about the wine-cvs mailing list