Bug 1132295 - Remove support for RegExp.prototype.unicode until Unicode regular expressions are supported, so that the property's presence is usable to feature-test for support for Unicode regular expressions. r=till
authorJeff Walden <jwalden@mit.edu>
Wed, 11 Feb 2015 17:09:01 -0800
changeset 256044 984e5db41c439c064b08cc397aa39a8007cb9db5
parent 256043 9cf76d4021ce9ee02aade9248e0999f43f2d82a3
child 256045 ff4cb45a4588e26472deb5483ee2450ff3685b0f
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstill
bugs1132295
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1132295 - Remove support for RegExp.prototype.unicode until Unicode regular expressions are supported, so that the property's presence is usable to feature-test for support for Unicode regular expressions. r=till
js/src/builtin/RegExp.cpp
js/src/tests/ecma_6/RegExp/descriptor.js
js/src/tests/ecma_6/RegExp/flag-accessors.js
--- a/js/src/builtin/RegExp.cpp
+++ b/js/src/builtin/RegExp.cpp
@@ -474,44 +474,23 @@ regexp_sticky_impl(JSContext *cx, CallAr
 static bool
 regexp_sticky(JSContext *cx, unsigned argc, JS::Value *vp)
 {
     /* Steps 1-3. */
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsRegExp, regexp_sticky_impl>(cx, args);
 }
 
-/* ES6 draft rev32 21.2.5.15. */
-MOZ_ALWAYS_INLINE bool
-regexp_unicode_impl(JSContext *cx, CallArgs args)
-{
-    MOZ_ASSERT(IsRegExp(args.thisv()));
-
-    /* Steps 4-6. */
-    /* FIXME: When the /u flags is supported, return correct value. */
-    args.rval().setBoolean(false);
-    return true;
-}
-
-static bool
-regexp_unicode(JSContext *cx, unsigned argc, JS::Value *vp)
-{
-    /* Steps 1-3. */
-    CallArgs args = CallArgsFromVp(argc, vp);
-    return CallNonGenericMethod<IsRegExp, regexp_unicode_impl>(cx, args);
-}
-
 static const JSPropertySpec regexp_properties[] = {
     JS_PSG("flags", regexp_flags, 0),
     JS_PSG("global", regexp_global, 0),
     JS_PSG("ignoreCase", regexp_ignoreCase, 0),
     JS_PSG("multiline", regexp_multiline, 0),
     JS_PSG("source", regexp_source, 0),
     JS_PSG("sticky", regexp_sticky, 0),
-    JS_PSG("unicode", regexp_unicode, 0),
     JS_PS_END
 };
 
 static const JSFunctionSpec regexp_methods[] = {
 #if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str,  regexp_toString,    0,0),
 #endif
     JS_FN(js_toString_str,  regexp_toString,    0,0),
--- a/js/src/tests/ecma_6/RegExp/descriptor.js
+++ b/js/src/tests/ecma_6/RegExp/descriptor.js
@@ -5,21 +5,25 @@ print(BUGNUMBER + ": " + summary);
 
 var getters = [
   "flags",
   "global",
   "ignoreCase",
   "multiline",
   "source",
   "sticky",
-  "unicode",
+  //"unicode",
 ];
 
 for (var name of getters) {
   var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, name);
   assertEq(desc.configurable, true);
   assertEq(desc.enumerable, false);
   assertEq("writable" in desc, false);
   assertEq("get" in desc, true);
 }
 
+// When the /u flag is supported, remove this comment and the next line, and
+// uncomment "unicode" in |props| above.
+assertThrowsInstanceOf(() => RegExp("", "mygui").flags, SyntaxError);
+
 if (typeof reportCompare === "function")
     reportCompare(true, true);
--- a/js/src/tests/ecma_6/RegExp/flag-accessors.js
+++ b/js/src/tests/ecma_6/RegExp/flag-accessors.js
@@ -3,25 +3,25 @@ var summary = "Implement RegExp.prototyp
 
 print(BUGNUMBER + ": " + summary);
 
 var props = [
   "global",
   "ignoreCase",
   "multiline",
   "sticky",
-  "unicode",
+  //"unicode",
 ];
 
 testThrows(RegExp.prototype);
 test(/foo/iymg, [true, true, true, true, false]);
 test(RegExp(""), [false, false, false, false, false]);
 test(RegExp("", "mygi"), [true, true, true, true, false]);
-// When the /u flag is supported, remove the following line and uncomment the
-// next line.
+// When the /u flag is supported, remove the following line, uncomment the
+// next line, and uncomment "unicode" in |props| above.
 assertThrowsInstanceOf(() => RegExp("", "mygui").flags, SyntaxError);
 // test(RegExp("", "mygiu"), [true, true, true, true, true]);
 
 testThrowsGeneric();
 testThrowsGeneric(1);
 testThrowsGeneric("");
 testThrowsGeneric({});
 testThrowsGeneric(new Proxy({}, {get(){ return true; }}));