<!-- Thank you for reporting an issue. This issue tracker is for bugs and issues found within Node.js core. If you require more general support please file an issue on our help repo. https://github.com/nodejs/help Please fill in as much of the template below as you're able. Version: output of `node -v` Platform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows) Subsystem: if known, please specify affected core module name If possible, please provide code that demonstrates the problem, keeping it as simple and free of external dependencies as you are able. --> * **Version**: v10.1.0 * **Platform**: Linux arch-seckinger 4.16.9-1-ARCH #1 SMP PREEMPT Thu May 17 02:10:09 UTC 2018 x86_64 GNU/Linux * **Subsystem**: assert Apparently introduced by #18322. I'm working on a PR to fix this. <!-- Enter your issue details below this comment. --> ## code ```javascript new Function("assert", "assert(1 === 2);")(require("assert")); ``` ## expected behavior (this is what happens with node 6, 7, 8 and 9) throws an `AssertionError: false == true` ## actual behavior (with node 10) throws ``` assert.js:163 if (filename.endsWith('.js') && NativeModule.exists(filename.slice(0, -3))) { ^ TypeError: Cannot read property 'endsWith' of undefined ```
Apparently introduced by #18322.
I'm working on a PR to fix this.
code
expected behavior
(this is what happens with node 6, 7, 8 and 9)
throws an
AssertionError: false == trueactual behavior
(with node 10)
throws