mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Fix nits.
This commit is contained in:
parent
f295229852
commit
1031f4fd6d
@ -114,7 +114,7 @@ static JSClass prop_iterator_class = {
|
||||
* Stack macros and functions. These all use a local variable, jsval *sp, to
|
||||
* point to the next free stack slot. SAVE_SP must be called before any call
|
||||
* to a function that may invoke the interpreter. RESTORE_SP must be called
|
||||
* only after return from Call, because only Call changes fp->sp.
|
||||
* only after return from js_Invoke, because only js_Invoke changes fp->sp.
|
||||
*/
|
||||
#define PUSH(v) (*sp++ = (v))
|
||||
#define POP() (*--sp)
|
||||
@ -778,8 +778,8 @@ js_Execute(JSContext *cx, JSObject *chain, JSScript *script, JSFunction *fun,
|
||||
frame.throwing = JS_FALSE;
|
||||
frame.dormantNext = NULL;
|
||||
|
||||
|
||||
/* Here we wrap the call to js_Interpret with code to (conditionally)
|
||||
/*
|
||||
* Here we wrap the call to js_Interpret with code to (conditionally)
|
||||
* save and restore the old stack frame chain into a chain of 'dormant'
|
||||
* frame chains. Since we are replacing cx->fp we were running into the
|
||||
* problem that if gc was called, then some of the objects associated
|
||||
@ -790,7 +790,6 @@ js_Execute(JSContext *cx, JSObject *chain, JSScript *script, JSFunction *fun,
|
||||
* chains and marks objects in the same way that it marks object in the
|
||||
* primary cx->fp chain.
|
||||
*/
|
||||
|
||||
if (oldfp && oldfp != down) {
|
||||
PR_ASSERT(!oldfp->dormantNext);
|
||||
oldfp->dormantNext = cx->dormantFrameChain;
|
||||
@ -885,9 +884,9 @@ ImportProperty(JSContext *cx, JSObject *obj, jsid id)
|
||||
goto out;
|
||||
}
|
||||
/*
|
||||
* The Closure() constructor resets the closure object's parent to be
|
||||
* the current scope chain. Set it to the object that the imported
|
||||
* function is being defined in.
|
||||
* The Closure() constructor resets the closure object's parent
|
||||
* to be the current scope chain. Set it to the object that the
|
||||
* imported function is being defined in.
|
||||
*/
|
||||
OBJ_SET_PARENT(cx, closure, obj);
|
||||
value = OBJECT_TO_JSVAL(closure);
|
||||
@ -1241,7 +1240,7 @@ js_Interpret(JSContext *cx, jsval *result)
|
||||
|
||||
do_forinloop:
|
||||
/*
|
||||
* ECMA-compatible for/in bytecodes eval object just once, before loop.
|
||||
* ECMA-compatible for/in evals the object just once, before loop.
|
||||
*/
|
||||
if (cs->format & JOF_FOR2) {
|
||||
obj = JSVAL_TO_OBJECT(sp[-1]);
|
||||
@ -2653,13 +2652,13 @@ js_Interpret(JSContext *cx, jsval *result)
|
||||
switch (handler(cx, script, pc, &rval,
|
||||
rt->debuggerHandlerData)) {
|
||||
case JSTRAP_ERROR:
|
||||
ok = JS_FALSE;
|
||||
goto out;
|
||||
ok = JS_FALSE;
|
||||
goto out;
|
||||
case JSTRAP_CONTINUE:
|
||||
break;
|
||||
break;
|
||||
case JSTRAP_RETURN:
|
||||
fp->rval = rval;
|
||||
goto out;
|
||||
fp->rval = rval;
|
||||
goto out;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
@ -986,15 +986,14 @@ Statement(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc)
|
||||
} else {
|
||||
/* Set pn1 to a var list or an initializing expression. */
|
||||
#if JS_HAS_IN_OPERATOR
|
||||
/*
|
||||
/*
|
||||
* Set the TCF_IN_FOR_INIT flag during parsing of the first clause
|
||||
* of the for statement. This flag will will be used by the
|
||||
* RelExpr production; if it flag is set, then the 'in' keyword
|
||||
* will not be recognized as an operator, leaving it available to
|
||||
* be parsed as part of a for/in loop. A side effect of this
|
||||
* restriction is that (unparenthesized) expressions involving an
|
||||
* 'in' operator are illegal in the init clause of an ordinary for
|
||||
* loop.
|
||||
* of the for statement. This flag will be used by the RelExpr
|
||||
* production; if it is set, then the 'in' keyword will not be
|
||||
* recognized as an operator, leaving it available to be parsed as
|
||||
* part of a for/in loop. A side effect of this restriction is
|
||||
* that (unparenthesized) expressions involving an 'in' operator
|
||||
* are illegal in the init clause of an ordinary for loop.
|
||||
*/
|
||||
tc->flags |= TCF_IN_FOR_INIT;
|
||||
#endif /* JS_HAS_IN_OPERATOR */
|
||||
@ -1120,7 +1119,7 @@ Statement(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc)
|
||||
* catch (v)
|
||||
* catch (v if <boolean_expression>)
|
||||
*/
|
||||
|
||||
|
||||
if (!catchtail->pn_kid1->pn_expr) {
|
||||
js_ReportCompileError(cx, ts,
|
||||
"catch clause after general catch");
|
||||
@ -1203,7 +1202,7 @@ Statement(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc)
|
||||
case TOK_CATCH:
|
||||
js_ReportCompileError(cx, ts, "catch without try");
|
||||
return NULL;
|
||||
|
||||
|
||||
case TOK_FINALLY:
|
||||
js_ReportCompileError(cx, ts, "finally without try");
|
||||
return NULL;
|
||||
@ -1861,7 +1860,7 @@ RelExpr(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc)
|
||||
|
||||
inForInitFlag = tc->flags & TCF_IN_FOR_INIT;
|
||||
/*
|
||||
* Uses of the in operator in ShiftExprs are always unambiguous,
|
||||
* Uses of the in operator in ShiftExprs are always unambiguous,
|
||||
* so unset the flag that prohibits recognizing it.
|
||||
*/
|
||||
tc->flags &= ~TCF_IN_FOR_INIT;
|
||||
@ -1889,7 +1888,7 @@ RelExpr(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc)
|
||||
/* Restore previous state of inForInit flag. */
|
||||
tc->flags |= inForInitFlag;
|
||||
#endif /* JS_HAS_IN_OPERATOR */
|
||||
|
||||
|
||||
return pn;
|
||||
}
|
||||
|
||||
|
@ -1996,8 +1996,8 @@ js_NewRegExp(JSContext *cx, JSString *str, uintN flags)
|
||||
#ifdef DEBUG_notme
|
||||
{
|
||||
/* print the compiled regexp program bytecode */
|
||||
jsuint i;
|
||||
for (i=0; i < state.progLength; i++) {
|
||||
size_t i;
|
||||
for (i = 0; i < state.progLength; i++) {
|
||||
int b = (int) re->program[i];
|
||||
fprintf(stderr, "%d", b);
|
||||
if ((i > 0 && i % 8 == 0) || i == state.progLength-1)
|
||||
|
Loading…
Reference in New Issue
Block a user