[Webkit-unassigned] [Bug 199744] New: A Possible Issue of Object.create method

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 11 20:22:39 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=199744

            Bug ID: 199744
           Summary: A Possible Issue of Object.create method
           Product: WebKit
           Version: WebKit Local Build
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: yaohouyou at stumail.nwu.edu.cn

#Testcase:
var foo = function () {
                var newObj = Object.create({}, 2);
                print(newObj);
};
foo();

#Command:
./webkit/WebKitBuild/Release/bin/jsc testcase.js

#Output:
Exception: TypeError: Property descriptor list must be an Object.
create@[native code]
foo at testcase.js:2:29
global code at testcase.js:5:4

#Expected output:
[object Object]

#Description:
According to ECMAScript-262, when the first parameter "O" of Object.create (O, Properties) is correct while the second parameter "Properties" is incorrect (shown as line 2 in the above testcase), the JS engine should ignore the illegal parameter and successfully create the object. However, when running the above testcase, javascriptCore throws a TypeError exception while other JS engines such as SpiderMonkey, V8 and chakra output "[object Object]". Is it a compatibility issue of javascriptCore or an extension of ECMAScript?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190712/3151865c/attachment.html>


More information about the webkit-unassigned mailing list