GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — node-8.9.3 two immediate execution function error · Issue #18275 · nodejs/node

node-8.9.3 two immediate execution function error #18275

New issue
Copy link
New issue
Copy link
Closed
Closed
node-8.9.3 two immediate execution function error#18275
Copy link

Description

@hhxx1994
hhxx1994
opened on Jan 21, 2018
Issue body actions
  • Version: 8.9.3
  • Platform: window 7 x64 webstorm 2017.3.3
(() => console.log("a"))()
(() => console.log("b"))()
(() => console.log("b"))()
^

TypeError: (intermediate value)(...) is not a function
    at Object.<anonymous> (D:\workspace\fb\helloworld\helloworld.js:2:1)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
a

but if I add a semicolon to one line is ok,like this

(() => console.log("a"))();
(() => console.log("b"))()

Activity

  1. nephross commented on Jan 21, 2018

    @nephross
    nephross
    on Jan 21, 2018
    Contributor
    More actions

    Without knowing for sure, I would venture to guess this issue is similar in nature to this one: #18054

    The automatic semicolon insertion performed by the V8 parser is not able to insert the semicolon in the correct spot for the code to execute as expected.

    Reacted by Vse Mozhe Buty
  2. lpinca commented on Jan 21, 2018

    @lpinca
    lpinca
    on Jan 21, 2018
    Member
    More actions

    This works as intended as you are basically writing this

    (() => {})()()

    The last function call is done on something that isn't a function, thus the error.

  3. benjamingr commented on Jan 21, 2018

    @benjamingr
    benjamingr
    on Jan 21, 2018
    Member
    More actions

    Hey, I'm going to go ahead and close this as this is expected JavaScript behavior and is not something Node.js can do anything about anyway.

    Thank you so much for taking the time to report a potential bug!

  4. benjamingr
    closed this as completedon Jan 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.