diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp index 9c329eac77e5..bb765a2b6769 100644 --- a/js/src/builtin/RegExp.cpp +++ b/js/src/builtin/RegExp.cpp @@ -479,26 +479,6 @@ regexp_sticky(JSContext *cx, unsigned argc, JS::Value *vp) return CallNonGenericMethod(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(cx, args); -} - static const JSPropertySpec regexp_properties[] = { JS_PSG("flags", regexp_flags, 0), JS_PSG("global", regexp_global, 0), @@ -506,7 +486,6 @@ static const JSPropertySpec regexp_properties[] = { 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 }; diff --git a/js/src/tests/ecma_6/RegExp/descriptor.js b/js/src/tests/ecma_6/RegExp/descriptor.js index cc545b3a6ae2..62dda8521fb4 100644 --- a/js/src/tests/ecma_6/RegExp/descriptor.js +++ b/js/src/tests/ecma_6/RegExp/descriptor.js @@ -10,7 +10,7 @@ var getters = [ "multiline", "source", "sticky", - "unicode", + //"unicode", ]; for (var name of getters) { @@ -21,5 +21,9 @@ for (var name of getters) { 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); diff --git a/js/src/tests/ecma_6/RegExp/flag-accessors.js b/js/src/tests/ecma_6/RegExp/flag-accessors.js index 57ea43cec6a5..4f169c8a4b2c 100644 --- a/js/src/tests/ecma_6/RegExp/flag-accessors.js +++ b/js/src/tests/ecma_6/RegExp/flag-accessors.js @@ -8,15 +8,15 @@ var props = [ "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]);