mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 1025184 - Make ConstTwoByteChars a Range. r=jandem
This commit is contained in:
parent
fb9a27f3f9
commit
6b7cecf106
@ -536,7 +536,7 @@ nsJSONListener::OnStopRequest(nsIRequest *aRequest, nsISupports *aContext,
|
||||
|
||||
JS::ConstTwoByteChars chars(reinterpret_cast<const char16_t*>(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);
|
||||
|
||||
|
@ -151,17 +151,13 @@ typedef mozilla::RangedPtr<const char16_t> ConstCharPtr;
|
||||
/*
|
||||
* Like TwoByteChars, but the chars are const.
|
||||
*/
|
||||
class ConstTwoByteChars : public mozilla::RangedPtr<const char16_t>
|
||||
class ConstTwoByteChars : public mozilla::Range<const char16_t>
|
||||
{
|
||||
public:
|
||||
ConstTwoByteChars(const ConstTwoByteChars &s) : ConstCharPtr(s) {}
|
||||
MOZ_IMPLICIT ConstTwoByteChars(const mozilla::RangedPtr<const char16_t> &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<const char16_t> Base;
|
||||
|
||||
using ConstCharPtr::operator=;
|
||||
public:
|
||||
ConstTwoByteChars() : Base() {}
|
||||
ConstTwoByteChars(const char16_t *aChars, size_t aLength) : Base(aChars, aLength) {}
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user