Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8005958

Exception in self invoking anonymous function

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • core-libs
    • None
    • b82
    • generic
    • generic
    • Verified

      My self invoking anonymous function
      (function() {})(2)

      The resulting exception.
      1/1 test.js ... Exception in thread "main" java.lang.AssertionError: Only return value on stack allowed at return point - depth=2 stack = [object, object]
              at jdk.nashorn.internal.codegen.MethodEmitter._return(MethodEmitter.java:1311)
              at jdk.nashorn.internal.codegen.CodeGenerator.enter(CodeGenerator.java:1460)
              at jdk.nashorn.internal.ir.ReturnNode.accept(ReturnNode.java:104)
              at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:318)
              at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:314)
              at jdk.nashorn.internal.codegen.Compiler.compile(Compiler.java:366)
              at jdk.nashorn.internal.runtime.Context.compile(Context.java:829)
              at jdk.nashorn.internal.runtime.Context.compileScript(Context.java:805)
              at jdk.nashorn.internal.runtime.Context.evaluateSource(Context.java:764)
              at jdk.nashorn.internal.runtime.Context.load(Context.java:608)
              at jdk.nashorn.internal.objects.Global.load(Global.java:694)
              at jdk.nashorn.internal.scripts.Script$evals_wrap._L26$_L86(jar:file:/E:/ws/nodejar/target/node-0.1.jar!/com/oracle/node/evals_wrap.js:87)
              at jdk.nashorn.internal.scripts.Script$module._L1$_L377(module.js:442)
              at jdk.nashorn.internal.scripts.Script$module._L1$_L470(module.js:472)
              at jdk.nashorn.internal.scripts.Script$module._L1$_L351(module.js:361)
              at jdk.nashorn.internal.scripts.Script$module._L1$_L275(module.js:312)
              at jdk.nashorn.internal.scripts.Script$module._L1$_L495(module.js:497)
              at jdk.nashorn.internal.scripts.Script$process._L1$_L213$_L216(process.js:217)
              at jdk.nashorn.internal.javaadapters.com.oracle.node.eventloop.Callback.call(Unknown Source)
              at com.oracle.node.eventloop.EventLoop.processEvents(EventLoop.java:182)
              at com.oracle.node.eventloop.EventLoop.run(EventLoop.java:166)
              at com.oracle.node.Server.run(Server.java:99)
              at com.oracle.node.Launcher.main(Launcher.java:31)
      2s FAILED

            attila Attila Szegedi
            kwwong Kinsley Wong (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: