[ES6] Use @isObject to check Object Type instead of using instanceof
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 17 Apr 2016 21:53:11 +0000 (21:53 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 17 Apr 2016 21:53:11 +0000 (21:53 +0000)
commitc8670a72884525cb2dded1af7dce9a59ce895079
treea6407a3ac087dc494c7aa86d60ec28437d50b154
parent953e8d884cd10c258f959c5ced6550e1f1f8a264
[ES6] Use @isObject to check Object Type instead of using instanceof
https://bugs.webkit.org/show_bug.cgi?id=156676

Reviewed by Darin Adler.

Use @isObject instead of `instanceof @Object`.
The `instanceof` check is not enough to check Object Type.
For example, given 2 realms, the object created in one realm does not inherit the Object of another realm.
Another example is that the object which does not inherit Object.
This object can be easily created by calling `Object.create(null)`.

* builtins/RegExpPrototype.js:
(match):
* jsc.cpp:
(GlobalObject::finishCreation):
(functionCreateGlobalObject):
* tests/stress/regexp-match-in-other-realm-should-work.js: Added.
(shouldBe):
* tests/stress/regexp-match-should-work-with-objects-not-inheriting-object-prototype.js: Added.
(shouldBe):
(regexp.exec):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/builtins/RegExpPrototype.js
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/tests/stress/regexp-match-in-other-realm-should-work.js [new file with mode: 0644]
Source/JavaScriptCore/tests/stress/regexp-match-should-work-with-objects-not-inheriting-object-prototype.js [new file with mode: 0644]