Skip to content

Wrong error message «TypeError: something is not a function» #3934

Closed
@ChALkeR

Description

@ChALkeR
for (var i = 0; i < 18436; i++);
require('http').notAFunction();

results in

require('http').notAFunction();
^
TypeError: require is not a function

But

for (var i = 0; i < 18435; i++);
require('http').notAFunction();

results in

require('http').notAFunction();
                ^
TypeError: require(...).notAFunction is not a function

For anything ≤ 18435 the error message is correct, for anything ≥ 18436 the error message is wrong.
Reproduced on v4.x and v5.1.0. If you can't reproduce that, try using some high number there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions