Bug 822283 - Make APIs that access strictMode() on the TokenStream private. r=njn

--HG--
extra : rebase_source : 9707c69c9a9dc5fd8f762e770d4fec9a03c98af2
This commit is contained in:
Benjamin Peterson 2012-12-17 19:51:54 -05:00
parent 645be75d17
commit 794ff95ee7
2 changed files with 5 additions and 13 deletions

View File

@ -611,16 +611,6 @@ TokenStream::reportWarning(unsigned errorNumber, ...)
return result;
}
bool
TokenStream::reportStrictWarning(unsigned errorNumber, ...)
{
va_list args;
va_start(args, errorNumber);
bool result = reportStrictWarningErrorNumberVA(NULL, strictMode(), errorNumber, args);
va_end(args);
return result;
}
bool
TokenStream::reportStrictWarningErrorNumberVA(ParseNode *pn, bool strictMode, unsigned errorNumber,
va_list args)

View File

@ -524,7 +524,6 @@ class TokenStream
void setXMLOnlyMode(bool enabled = true) { setFlag(enabled, TSF_XMLONLYMODE); }
void setUnexpectedEOF(bool enabled = true) { setFlag(enabled, TSF_UNEXPECTED_EOF); }
bool strictMode() const { return strictModeGetter && strictModeGetter->get(); }
bool isXMLTagMode() const { return !!(flags & TSF_XMLTAGMODE); }
bool isXMLOnlyMode() const { return !!(flags & TSF_XMLONLYMODE); }
bool isUnexpectedEOF() const { return !!(flags & TSF_UNEXPECTED_EOF); }
@ -534,8 +533,6 @@ class TokenStream
// TokenStream-specific error reporters.
bool reportError(unsigned errorNumber, ...);
bool reportWarning(unsigned errorNumber, ...);
bool reportStrictWarning(unsigned errorNumber, ...);
bool reportStrictModeError(unsigned errorNumber, ...);
// General-purpose error reporters. You should avoid calling these
// directly, and instead use the more succinct alternatives (e.g.
@ -548,6 +545,11 @@ class TokenStream
va_list args);
private:
// These are private because they should only be called by the tokenizer
// while tokenizing not by, for example, BytecodeEmitter.
bool reportStrictModeError(unsigned errorNumber, ...);
bool strictMode() const { return strictModeGetter && strictModeGetter->get(); }
void onError();
static JSAtom *atomize(JSContext *cx, CharBuffer &cb);
bool putIdentInTokenbuf(const jschar *identStart);