ES6 spec requires that RegExpPrototype not be a RegExp object.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Mar 2016 23:14:34 +0000 (23:14 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Mar 2016 23:14:34 +0000 (23:14 +0000)
commit2a6b48c5ebedcb47f661bd5a271c6cf9350bc334
tree11b425c2a0813a0cf809deb375cec2d435f50003
parentaf4b8c194b89e5fb4dab8fe3fa964e41bc6db92e
ES6 spec requires that RegExpPrototype not be a RegExp object.
https://bugs.webkit.org/show_bug.cgi?id=155654

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

The ES6 spec states that RegExp.prototype should not be an instance of RegExp:
https://tc39.github.io/ecma262/#sec-properties-of-the-regexp-prototype-object

"The RegExp prototype object is an ordinary object. It is not a RegExp instance
and does not have a [[RegExpMatcher]] internal slot or any of the other internal
slots of RegExp instance objects."

This patch changes RegExpPrototype to conform to the above specifications.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/RegExpConstructor.cpp:
(JSC::RegExpConstructor::RegExpConstructor):
(JSC::RegExpConstructor::finishCreation):
* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::RegExpPrototype):
(JSC::RegExpPrototype::finishCreation):
(JSC::RegExpPrototype::getOwnPropertySlot):
(JSC::RegExpPrototype::visitChildren):
(JSC::regExpProtoFuncTest):
* runtime/RegExpPrototype.h:
(JSC::RegExpPrototype::create):
(JSC::RegExpPrototype::createStructure):
(JSC::RegExpPrototype::emptyRegExp):

* tests/es6.yaml:
- This patch makes the es6/miscellaneous_built-in_prototypes_are_not_instances.js
  test now pass.  However, the kangax version of this test still fails because
  it also checks Error objects (which will be fixed in a subsequent patch).

* tests/mozilla/ecma_2/shell.js:
(stringify):
(test):
(getFailedCases):
(err):
* tests/stress/static-getter-in-names.js:
(shouldBe):

LayoutTests:

Rebase all the test results.

* fast/regex/script-tests/toString.js:
* fast/regex/toString-expected.txt:
* ietestcenter/Javascript/15.10.6-expected.txt:
* ietestcenter/Javascript/15.10.7.1-1-expected.txt:
* ietestcenter/Javascript/15.10.7.2-1-expected.txt:
* ietestcenter/Javascript/15.10.7.3-1-expected.txt:
* ietestcenter/Javascript/15.10.7.4-1-expected.txt:
* ietestcenter/Javascript/15.10.7.5-1-expected.txt:
* ietestcenter/Javascript/TestCases/15.10.6.js:
(ES5Harness.registerTest.test):
* ietestcenter/Javascript/TestCases/15.10.7.1-1.js:
(ES5Harness.registerTest.test):
* ietestcenter/Javascript/TestCases/15.10.7.2-1.js:
(ES5Harness.registerTest.test):
* ietestcenter/Javascript/TestCases/15.10.7.3-1.js:
(ES5Harness.registerTest.test):
* ietestcenter/Javascript/TestCases/15.10.7.4-1.js:
(ES5Harness.registerTest.test):
* ietestcenter/Javascript/TestCases/15.10.7.5-1.js:
(ES5Harness.registerTest.test):
* js/Object-getOwnPropertyNames-expected.txt:
* js/kde/RegExp-expected.txt:
* js/kde/script-tests/RegExp.js:
* js/script-tests/Object-getOwnPropertyNames.js:
* sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.6/S15.10.6_A2-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/regex/script-tests/toString.js
LayoutTests/fast/regex/toString-expected.txt
LayoutTests/ietestcenter/Javascript/15.10.6-expected.txt
LayoutTests/ietestcenter/Javascript/15.10.7.1-1-expected.txt
LayoutTests/ietestcenter/Javascript/15.10.7.2-1-expected.txt
LayoutTests/ietestcenter/Javascript/15.10.7.3-1-expected.txt
LayoutTests/ietestcenter/Javascript/15.10.7.4-1-expected.txt
LayoutTests/ietestcenter/Javascript/15.10.7.5-1-expected.txt
LayoutTests/ietestcenter/Javascript/TestCases/15.10.6.js
LayoutTests/ietestcenter/Javascript/TestCases/15.10.7.1-1.js
LayoutTests/ietestcenter/Javascript/TestCases/15.10.7.2-1.js
LayoutTests/ietestcenter/Javascript/TestCases/15.10.7.3-1.js
LayoutTests/ietestcenter/Javascript/TestCases/15.10.7.4-1.js
LayoutTests/ietestcenter/Javascript/TestCases/15.10.7.5-1.js
LayoutTests/js/Object-getOwnPropertyNames-expected.txt
LayoutTests/js/kde/RegExp-expected.txt
LayoutTests/js/kde/script-tests/RegExp.js
LayoutTests/js/script-tests/Object-getOwnPropertyNames.js
LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.6/S15.10.6_A2-expected.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/RegExpConstructor.cpp
Source/JavaScriptCore/runtime/RegExpPrototype.cpp
Source/JavaScriptCore/runtime/RegExpPrototype.h
Source/JavaScriptCore/tests/es6.yaml
Source/JavaScriptCore/tests/mozilla/ecma_2/shell.js
Source/JavaScriptCore/tests/stress/static-getter-in-names.js