|
|
|
@ -427,6 +427,7 @@ function generateJS( ast, options ) {
|
|
|
|
|
" ip++;",
|
|
|
|
|
" break;",
|
|
|
|
|
"",
|
|
|
|
|
" // istanbul ignore next",
|
|
|
|
|
" default:",
|
|
|
|
|
" throw new Error(\"Invalid opcode: \" + bc[ip] + \".\");",
|
|
|
|
|
" }",
|
|
|
|
@ -533,6 +534,7 @@ function generateJS( ast, options ) {
|
|
|
|
|
elseSp = stack.sp;
|
|
|
|
|
ip += elseLength;
|
|
|
|
|
|
|
|
|
|
// istanbul ignore if
|
|
|
|
|
if ( thenSp !== elseSp ) {
|
|
|
|
|
|
|
|
|
|
throw new Error(
|
|
|
|
@ -567,6 +569,7 @@ function generateJS( ast, options ) {
|
|
|
|
|
bodySp = stack.sp;
|
|
|
|
|
ip += bodyLength;
|
|
|
|
|
|
|
|
|
|
// istanbul ignore if
|
|
|
|
|
if ( bodySp !== baseSp ) {
|
|
|
|
|
|
|
|
|
|
throw new Error( "Body of a loop can't move the stack pointer." );
|
|
|
|
@ -780,6 +783,7 @@ function generateJS( ast, options ) {
|
|
|
|
|
ip++;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
// istanbul ignore next
|
|
|
|
|
default:
|
|
|
|
|
throw new Error( "Invalid opcode: " + bc[ ip ] + "." );
|
|
|
|
|
|
|
|
|
@ -843,6 +847,7 @@ function generateJS( ast, options ) {
|
|
|
|
|
" this.location = location;",
|
|
|
|
|
" this.name = \"SyntaxError\";",
|
|
|
|
|
"",
|
|
|
|
|
" // istanbul ignore next",
|
|
|
|
|
" if (typeof Error.captureStackTrace === \"function\") {",
|
|
|
|
|
" Error.captureStackTrace(this, peg$SyntaxError);",
|
|
|
|
|
" }",
|
|
|
|
@ -1003,6 +1008,7 @@ function generateJS( ast, options ) {
|
|
|
|
|
" log(event);",
|
|
|
|
|
" break;",
|
|
|
|
|
"",
|
|
|
|
|
" // istanbul ignore next",
|
|
|
|
|
" default:",
|
|
|
|
|
" throw new Error(\"Invalid event type: \" + event.type + \".\");",
|
|
|
|
|
" }",
|
|
|
|
|