Giter Site home page Giter Site logo

Comments (19)

s-a avatar s-a commented on August 17, 2024

Can you setup a simplified project to reproduce the error and create a repo at github? I d like to inspect this.
Never Seen this before. Looks like a crash in chromium.

from iron-node.

s-a avatar s-a commented on August 17, 2024

Are you spawning processes there? Maybe there are more infos in your terminal console log.

from iron-node.

mik01aj avatar mik01aj commented on August 17, 2024

I created a small example: https://gist.github.com/mik01aj/873aa20f73716f626738

from iron-node.

s-a avatar s-a commented on August 17, 2024

Thanks. You are running iron-node suite.js right? I will test this this evening

from iron-node.

mik01aj avatar mik01aj commented on August 17, 2024

Yes.

from iron-node.

s-a avatar s-a commented on August 17, 2024

OK.
I was able to run the test suite.
image

And I was able to debug the test suite.
image

Jasmine calls process.exit which seems to cause a crash.
image

This hot fixes the issue.

process.exit = function() {}

Well this should impact other Libraries too so I need to overwrite process.exitand output exitcode to console.

from iron-node.

s-a avatar s-a commented on August 17, 2024

Can you confirm that ? I updated your gist at https://gist.github.com/s-a/aaec29ad03cd7138ca8a#file-suite-js-L10

from iron-node.

s-a avatar s-a commented on August 17, 2024

Regarding the strange console log I created a ticket at electron/electron#2390.
We should change the issue title because there is nothing you can debug there 😸

from iron-node.

s-a avatar s-a commented on August 17, 2024

In case of a script calls process.exit() you will see now a toaster as notification. This is much more fun 😃

image

from iron-node.

mik01aj avatar mik01aj commented on August 17, 2024

Nice!

I have one more idea: maybe system.exit should be mocked with function () { debugger; }?

from iron-node.

s-a avatar s-a commented on August 17, 2024

I think that's something users should decide for themselves. For some people it could be irritating. You can create packages very easy to implement your desired behavior.

An example package is here
https://github.com/s-a/iron-node-zerodarkmatrix-theme/blob/master/index.js. I would love to See various mutations of addons at the package channel.

from iron-node.

mik01aj avatar mik01aj commented on August 17, 2024

How about this example?

setTimeout(function () { process.exit(); }, 1000);
setTimeout(function () { console.log('You will never know what I wanted to tell you'); }, 1001);

Will the message show up in iron-node? I think it will, and imho it shouldn't.

from iron-node.

s-a avatar s-a commented on August 17, 2024

Yes it is a little bit weird. Would be nice to find a way to stop script execution if exit was called which is far from trivial. Seems you found a limitation here.

from iron-node.

mik01aj avatar mik01aj commented on August 17, 2024

When you put a breakpoint there, it becomes trivial :) And you can put the real process.exit after it so that these strange situations will not happen.

A breakpoint at exit is very useful imho, because then I am able to inspect whole application state at exit. Think about a command/line script. It can have process.exit() on the end or not, it's roughly equivalent (minus waiting for any pending calls from setTimeout, setInterval, process.nextTick, Promises or similar async mechanisms). I think that they should be "roughly equivalent" in the debugger as well, so that in both these cases (I mean a. scripts exititing explicitly using proces.exit and b. scripts exiting implicitly by finishing executing the main script and emptying the event loop):

  1. the process behaves the same both in normal runtime and in debugger
  2. it is easy to debug post-mortem state of the process.

from iron-node.

s-a avatar s-a commented on August 17, 2024

We can not avoid the situation. process.exit will cause a crash because everything is based on node. Anything beyond process.exit will exit the GUI application.
So far there is no way to detect script finished especially pending async methods done events.

from iron-node.

s-a avatar s-a commented on August 17, 2024

@mik01aj check out https://github.com/s-a/iron-node-process-exit-break

from iron-node.

mik01aj avatar mik01aj commented on August 17, 2024

It works great! Thanks! :)

from iron-node.

mik01aj avatar mik01aj commented on August 17, 2024

I owe you a beer when I come to Hamburg!

from iron-node.

s-a avatar s-a commented on August 17, 2024

👍 😄

from iron-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.