Add Script.prototype.getAllOffsets and getLineOffsets.

This commit is contained in:
Jason Orendorff
2011-06-28 14:46:00 -05:00
parent 8598173449
commit faf9b28aff
5 changed files with 296 additions and 5 deletions

View File

@@ -545,6 +545,14 @@ GetBytecodeLength(JSContext *cx, JSScript *script, jsbytecode *pc);
extern bool
IsValidBytecodeOffset(JSContext *cx, JSScript *script, size_t offset);
inline bool
FlowsIntoNext(JSOp op)
{
// JSOP_YIELD is considered to flow into the next instruction, like JSOP_CALL.
return op != JSOP_STOP && op != JSOP_RETURN && op != JSOP_RETRVAL && op != JSOP_THROW &&
op != JSOP_GOTO && op != JSOP_GOTOX && op != JSOP_RETSUB;
}
}
#endif