-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: implement IsInsideNodeModules() in C++ #55286
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const fixtures = require('../common/fixtures'); | ||
const { spawnSyncAndAssert } = require('../common/child_process'); | ||
|
||
if (process.env.NODE_PENDING_DEPRECATION) | ||
common.skip('test does not work when NODE_PENDING_DEPRECATION is set'); | ||
|
||
spawnSyncAndAssert( | ||
process.execPath, | ||
[ fixtures.path('warning_node_modules', 'new-buffer-cjs.js') ], | ||
{ | ||
trim: true, | ||
stderr: '', | ||
} | ||
); | ||
|
||
spawnSyncAndAssert( | ||
process.execPath, | ||
[ fixtures.path('warning_node_modules', 'new-buffer-esm.mjs') ], | ||
{ | ||
trim: true, | ||
stderr: '', | ||
} | ||
); | ||
|
||
spawnSyncAndAssert( | ||
process.execPath, | ||
[ | ||
'--pending-deprecation', | ||
fixtures.path('warning_node_modules', 'new-buffer-cjs.js'), | ||
], | ||
{ | ||
stderr: /DEP0005/ | ||
} | ||
); | ||
|
||
spawnSyncAndAssert( | ||
process.execPath, | ||
[ | ||
'--pending-deprecation', | ||
fixtures.path('warning_node_modules', 'new-buffer-esm.mjs'), | ||
], | ||
{ | ||
stderr: /DEP0005/ | ||
} | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add V8 fast api to this to speed things up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if it's safe to iterate over the stack in the fast calls - probably safer to leave it to a follow up to avoid regressions if it's not and isn't reproducible from the tests.