You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wrong error message «TypeError: something is not a function» #3934
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.
This surely got a nice score in the weirdometer. Does anyone know why the breakpoint at 18435? Looking at the fix it doesn't seem like anything trivial.
The problem is that without the patch, optimized code computes the wrong message location.
I don't know why the threshold is at exactly 18436, but V8 decides to optimize the function starting from this number of iterations.
Activity
targos commentedon Nov 20, 2015
I can reproduce it with d8 4.6:
Disabling crankshaft fixes it:
The problem is fixed in the 4.7 branch of V8.
rvagg commentedon Nov 20, 2015
/cc @nodejs/v8
If we can identify the fix in V8 and a it's not too complex this it seems like a good candidate for backporting all the way to v4.x.
targos commentedon Nov 20, 2015
Found it !
PR incoming ;)
deps: backport 819b40a from V8 upstream
targos commentedon Nov 20, 2015
Fix for v5.x: #3937
targos commentedon Nov 20, 2015
Fix for v4.x: #3938
a0viedo commentedon Nov 20, 2015
This surely got a nice score in the weirdometer. Does anyone know why the breakpoint at
18435? Looking at the fix it doesn't seem like anything trivial.targos commentedon Nov 20, 2015
The problem is that without the patch, optimized code computes the wrong message location.
I don't know why the threshold is at exactly 18436, but V8 decides to optimize the function starting from this number of iterations.
deps: backport 819b40a from V8 upstream
deps: backport 819b40a from V8 upstream
deps: backport 819b40a from V8 upstream
deps: backport 819b40a from V8 upstream
deps: backport 819b40a from V8 upstream
deps: backport 819b40a from V8 upstream
deps: backport 819b40a from V8 upstream