diff --git a/dom/json/nsJSON.cpp b/dom/json/nsJSON.cpp index 790da1298c8d..86f68106866b 100644 --- a/dom/json/nsJSON.cpp +++ b/dom/json/nsJSON.cpp @@ -536,7 +536,7 @@ nsJSONListener::OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, JS::ConstTwoByteChars chars(reinterpret_cast(mBufferedChars.Elements()), mBufferedChars.Length()); - bool ok = JS_ParseJSONWithReviver(mCx, chars.get(), + bool ok = JS_ParseJSONWithReviver(mCx, chars.start().get(), uint32_t(mBufferedChars.Length()), reviver, &value); diff --git a/js/public/CharacterEncoding.h b/js/public/CharacterEncoding.h index 666573211211..397a5aaad582 100644 --- a/js/public/CharacterEncoding.h +++ b/js/public/CharacterEncoding.h @@ -151,17 +151,13 @@ typedef mozilla::RangedPtr ConstCharPtr; /* * Like TwoByteChars, but the chars are const. */ -class ConstTwoByteChars : public mozilla::RangedPtr +class ConstTwoByteChars : public mozilla::Range { - public: - ConstTwoByteChars(const ConstTwoByteChars &s) : ConstCharPtr(s) {} - MOZ_IMPLICIT ConstTwoByteChars(const mozilla::RangedPtr &s) : ConstCharPtr(s) {} - ConstTwoByteChars(const char16_t *s, size_t len) : ConstCharPtr(s, len) {} - ConstTwoByteChars(const char16_t *pos, const char16_t *start, size_t len) - : ConstCharPtr(pos, start, len) - {} + typedef mozilla::Range Base; - using ConstCharPtr::operator=; + public: + ConstTwoByteChars() : Base() {} + ConstTwoByteChars(const char16_t *aChars, size_t aLength) : Base(aChars, aLength) {} }; /* diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp index 3d3b4bd50b02..f99d19b2af46 100644 --- a/js/src/jsfun.cpp +++ b/js/src/jsfun.cpp @@ -1820,7 +1820,7 @@ FunctionConstructor(JSContext *cx, unsigned argc, Value *vp, GeneratorKind gener * here (duplicate argument names, etc.) will be detected when we * compile the function body. */ - TokenStream ts(cx, options, collected_args.get(), args_length, + TokenStream ts(cx, options, collected_args.start().get(), args_length, /* strictModeGetter = */ nullptr); bool yieldIsValidName = ts.versionNumber() < JSVERSION_1_7 && !isStarGenerator;