mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 891215 (part 4) - Slim down ParseNode-inl.h. r=terrence.
--HG-- extra : rebase_source : 282aa80825d69f2faf012d920ac0cf916dda6b93
This commit is contained in:
parent
3f67f7450e
commit
6b54c34e0b
@ -13,22 +13,6 @@
|
||||
namespace js {
|
||||
namespace frontend {
|
||||
|
||||
inline bool
|
||||
UpvarCookie::set(JSContext *cx, unsigned newLevel, uint16_t newSlot)
|
||||
{
|
||||
// This is an unsigned-to-uint16_t conversion, test for too-high values.
|
||||
// In practice, recursion in Parser and/or BytecodeEmitter will blow the
|
||||
// stack if we nest functions more than a few hundred deep, so this will
|
||||
// never trigger. Oh well.
|
||||
if (newLevel >= FREE_LEVEL) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_TOO_DEEP, js_function_str);
|
||||
return false;
|
||||
}
|
||||
level_ = newLevel;
|
||||
slot_ = newSlot;
|
||||
return true;
|
||||
}
|
||||
|
||||
inline PropertyName *
|
||||
ParseNode::name() const
|
||||
{
|
||||
|
@ -51,7 +51,19 @@ class UpvarCookie
|
||||
uint16_t slot() const { JS_ASSERT(!isFree()); return slot_; }
|
||||
|
||||
// This fails and issues an error message if newLevel is too large.
|
||||
bool set(JSContext *cx, unsigned newLevel, uint16_t newSlot);
|
||||
bool set(JSContext *cx, unsigned newLevel, uint16_t newSlot) {
|
||||
// This is an unsigned-to-uint16_t conversion, test for too-high
|
||||
// values. In practice, recursion in Parser and/or BytecodeEmitter
|
||||
// will blow the stack if we nest functions more than a few hundred
|
||||
// deep, so this will never trigger. Oh well.
|
||||
if (newLevel >= FREE_LEVEL) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_TOO_DEEP, js_function_str);
|
||||
return false;
|
||||
}
|
||||
level_ = newLevel;
|
||||
slot_ = newSlot;
|
||||
return true;
|
||||
}
|
||||
|
||||
void makeFree() {
|
||||
level_ = FREE_LEVEL;
|
||||
|
Loading…
Reference in New Issue
Block a user