Skip to content

Bugs on some implicit function calls #5

Description

@Tidyzq

As we know, JavaScript is a pretty dynamic language, becuase it contains many implicit function calls: getter/setter, Proxy, Symbol.iterator etc.

As this project only handles explicit function calls, those implicit calls will meet unexpected behavior:

const run = vDebugger.debug(`// here's line 1
Object.defineProperty(globalThis, 'a', {
  get: () => {
    return 1
  }
})
console.log(a === 1)
`, './test.js');

vDebugger.setBreakpoint('./test.js', 3); // break at line 3

run();

vDebugger.resume(); // should output "true", got "false"
const run = vDebugger.debug(`// here's line 1
const a = {}
a[Symbol.iterator] = function * () {
  yield 1
}
for (const i of a) {
  console.log(i)
}
`, './test.js');

run() // should output "1", got nothing

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