haikuwebkit/LayoutTests/js/pic
Mark Lam f0ec91481a Update treatment of invoking RegExp.prototype methods on RegExp.prototype.
https://bugs.webkit.org/show_bug.cgi?id=155922

Reviewed by Keith Miller.

Source/JavaScriptCore:

According to the TC39 committee, when invoking the following RegExp.prototype
methods on the RegExp.prototype:
1. RegExp.prototype.flags yields ""
2. RegExp.prototype.global yields undefined
3. RegExp.prototype.ignoreCase yields undefined
4. RegExp.prototype.multiline yields undefined
5. RegExp.prototype.unicode yields undefined
6. RegExp.prototype.source yields "(?:)"
7. RegExp.prototype.sticky yields undefined
8. RegExp.prototype.toString() yields "/(?:)/"

and RegExp.prototype is still NOT an instance of RegExp.  The above behavior
changes is a special dispensation applicable only to RegExp.prototype.  The ES6
spec of throwing errors still applies if those methods are applied to anything =
else that is not a RegExp object.

* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoGetterGlobal):
(JSC::regExpProtoGetterIgnoreCase):
(JSC::regExpProtoGetterMultiline):
(JSC::regExpProtoGetterSticky):
(JSC::regExpProtoGetterUnicode):
(JSC::regExpProtoGetterFlags):
(JSC::regExpProtoGetterSource):
- Implemented new behavior.

* tests/es6/miscellaneous_built-in_prototypes_are_not_instances.js:
(test):
- Updated to match current kangax test.

LayoutTests:

* fast/regex/script-tests/toString.js:
* fast/regex/toString-expected.txt:
* ietestcenter/Javascript/15.10.7.1-1-expected.txt:
* ietestcenter/Javascript/TestCases/15.10.7.1-1.js:
(ES5Harness.registerTest.test):
* js/kde/RegExp-expected.txt:
* js/kde/script-tests/RegExp.js:
* js/pic/cached-named-property-getter.html:
* js/regexp-flags-expected.txt:
* js/script-tests/regexp-flags.js:
- updated test behaviors in some cases, and rebased results as needed.

* js/regress/regexp-prototype-is-not-instance-expected.txt: Added.
* js/regress/regexp-prototype-is-not-instance.html: Added.
* js/regress/script-tests/regexp-prototype-is-not-instance.js: Added.
- Tests new RegExp.prototype method behaviors.



Canonical link: https://commits.webkit.org/174685@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199545 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-14 18:16:35 +00:00
..
cached-array-length-access-expected.txt
cached-array-length-access.html
cached-deleted-properties-expected.txt
cached-deleted-properties.html
cached-getter-dictionary-and-proto-expected.txt
cached-getter-dictionary-and-proto.html
cached-getter-setter-expected.txt
cached-getter-setter.html
cached-named-property-getter-expected.txt
cached-named-property-getter.html Update treatment of invoking RegExp.prototype methods on RegExp.prototype. 2016-04-14 18:16:35 +00:00
cached-prototype-setter-expected.txt
cached-prototype-setter.html
cached-prototype-then-immediate-expected.txt
cached-prototype-then-immediate.html
cached-single-entry-transition-expected.txt
cached-single-entry-transition.html
delete-global-object-expected.txt
delete-global-object.html
dictionary-prototype-expected.txt
dictionary-prototype.html
get-empty-string-expected.txt
get-empty-string.html
get-set-proxy-object-expected.txt
get-set-proxy-object.html
rehash-poisons-structure-expected.txt
rehash-poisons-structure.html
undictionary-expected.txt
undictionary.html