Esempio n. 1
0
 public static void injectLineNumber(CodeBlock block, Statement statement) {
   Position position = statement.getPosition();
   if (position != null) {
     LabelNode lineLabel = new LabelNode();
     block.line(position.getLine(), lineLabel);
     block.label(lineLabel);
   }
 }
Esempio n. 2
0
 @Override
 public CodeBlock getCodeBlock() {
   return CodeBlock.newCodeBlock()
       .append(propertyName.getCodeBlock())
       .append(expr.getCodeBlock())
       .invokeinterface(
           DynJSCompiler.Types.Scope, "define", sig(void.class, String.class, Object.class));
 }
Esempio n. 3
0
 public CodeBlock jsCheckObjectCoercible(final String debug) {
   CodeBlock codeBlock =
       new CodeBlock()
           // IN: obj
           .dup()
           // obj obj
           .aload(Arities.EXECUTION_CONTEXT)
           // obj obj context
           .swap();
   // obj context obj
   if (debug != null) {
     codeBlock.ldc(debug);
   } else {
     codeBlock.aconst_null();
   }
   codeBlock.invokestatic(
       p(Types.class),
       "checkObjectCoercible",
       sig(void.class, ExecutionContext.class, Object.class, String.class));
   // obj
   return codeBlock;
 }