Skip to content

Weird behavior that comment matters what's happening. #240

Closed
@ILyoan

Description

@ILyoan

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:

  1. checkout iotjs/fs_readfile
  2. build
    • $ ./tools/build.py
  3. goto test directory
    • $ cd test/run_pass
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviour

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions