Bug 1067009 - Const-correct a few jsapi methods. r=billm
authorBobby Holley <bobbyholley@gmail.com>
Wed, 01 Oct 2014 17:22:14 +0200
changeset 208192 34c3db9dabd4d1ca51200e09ddce1910f50ddc68
parent 208191 35ffc28c9330b62ee842469f2f173aa5f954a046
child 208193 691f25f5e6b3a0e72600186eb6e576d87285eda1
push id49867
push userbobbyholley@gmail.com
push dateWed, 01 Oct 2014 15:22:42 +0000
treeherdermozilla-inbound@95e16edcc745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1067009
milestone35.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 1067009 - Const-correct a few jsapi methods. r=billm
js/src/jsapi.cpp
js/src/jsapi.h
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -5819,17 +5819,17 @@ JS_ClearDateCaches(JSContext *cx)
 }
 
 /************************************************************************/
 
 /*
  * Regular Expressions.
  */
 JS_PUBLIC_API(JSObject *)
-JS_NewRegExpObject(JSContext *cx, HandleObject obj, char *bytes, size_t length, unsigned flags)
+JS_NewRegExpObject(JSContext *cx, HandleObject obj, const char *bytes, size_t length, unsigned flags)
 {
     AssertHeapIsIdle(cx);
     CHECK_REQUEST(cx);
     ScopedJSFreePtr<char16_t> chars(InflateString(cx, bytes, &length));
     if (!chars)
         return nullptr;
 
     RegExpStatics *res = obj->as<GlobalObject>().getRegExpStatics(cx);
@@ -5837,17 +5837,17 @@ JS_NewRegExpObject(JSContext *cx, Handle
         return nullptr;
 
     RegExpObject *reobj = RegExpObject::create(cx, res, chars, length,
                                                RegExpFlag(flags), nullptr, cx->tempLifoAlloc());
     return reobj;
 }
 
 JS_PUBLIC_API(JSObject *)
-JS_NewUCRegExpObject(JSContext *cx, HandleObject obj, char16_t *chars, size_t length,
+JS_NewUCRegExpObject(JSContext *cx, HandleObject obj, const char16_t *chars, size_t length,
                      unsigned flags)
 {
     AssertHeapIsIdle(cx);
     CHECK_REQUEST(cx);
     RegExpStatics *res = obj->as<GlobalObject>().getRegExpStatics(cx);
     if (!res)
         return nullptr;
 
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -4754,21 +4754,21 @@ JS_ClearDateCaches(JSContext *cx);
  * Regular Expressions.
  */
 #define JSREG_FOLD      0x01u   /* fold uppercase to lowercase */
 #define JSREG_GLOB      0x02u   /* global exec, creates array of matches */
 #define JSREG_MULTILINE 0x04u   /* treat ^ and $ as begin and end of line */
 #define JSREG_STICKY    0x08u   /* only match starting at lastIndex */
 
 extern JS_PUBLIC_API(JSObject *)
-JS_NewRegExpObject(JSContext *cx, JS::HandleObject obj, char *bytes, size_t length,
+JS_NewRegExpObject(JSContext *cx, JS::HandleObject obj, const char *bytes, size_t length,
                    unsigned flags);
 
 extern JS_PUBLIC_API(JSObject *)
-JS_NewUCRegExpObject(JSContext *cx, JS::HandleObject obj, char16_t *chars, size_t length,
+JS_NewUCRegExpObject(JSContext *cx, JS::HandleObject obj, const char16_t *chars, size_t length,
                      unsigned flags);
 
 extern JS_PUBLIC_API(bool)
 JS_SetRegExpInput(JSContext *cx, JS::HandleObject obj, JS::HandleString input,
                   bool multiline);
 
 extern JS_PUBLIC_API(bool)
 JS_ClearRegExpStatics(JSContext *cx, JS::HandleObject obj);