Closed
Description
I encountered a weird situation that I could not figure out what's going on that running a program ends with unexpected result runs good when added comments.
You may reproduce it by:
- checkout iotjs/fs_readfile
- build
$ ./tools/build.py
- goto test directory
$ cd test/run_pass
- run the program
$ ../../build/x86_64-linux/debug/iotjs/iotjs test_net.js
If you see this:
uncaughtException: TypeError
uncaughtException: AssertionError: { actual: 1, expected: 0, operator: == }
It is the unexpected result.
If you change the program "test_net.js" slightly by adding comment like this:
process.on('exit', function(code) {
// comment meaning nothing.
assert.equal(code, 0);
assert.equal(msg, "Hello IoT.js");
});
The program will end good.