diff --git a/src/jsifier.mjs b/src/jsifier.mjs index 6d9f25560f09a..a91a8dfbde6cd 100644 --- a/src/jsifier.mjs +++ b/src/jsifier.mjs @@ -389,12 +389,10 @@ export async function runJSify(outputFile, symbolsOnly) { } function processLibraryFunction(snippet, symbol, mangled, deps, isStub) { - // It is possible that when printing the function as a string on Windows, - // the js interpreter we are in returns the string with Windows line endings - // \r\n. This is undesirable, since line endings are managed in the form \n - // in the output for binary file writes, so make sure the endings are - // uniform. - snippet = snippet.toString().replace(/\r\n/gm, '\n'); + snippet = snippet.toString(); + + // Node's toString() should not return windows line endings, even on windows. + assert(!snippet.includes('\r\n'), `${symbol} contains windows newlines:` + snippet); // Is this a shorthand `foo() {}` method syntax? // If so, prepend a function keyword so that it's valid syntax when extracted. diff --git a/src/lib/libcore.js b/src/lib/libcore.js index 9c2f828c43920..828ed0c4a422c 100644 --- a/src/lib/libcore.js +++ b/src/lib/libcore.js @@ -2268,7 +2268,7 @@ addToLibrary({ }, $getNativeTypeSize__deps: ['$POINTER_SIZE'], - $getNativeTypeSize: {{{ getNativeTypeSize }}}, + $getNativeTypeSize: {{{ getNativeTypeSize.toString() }}}, $wasmTable__docs: '/** @type {WebAssembly.Table} */', #if RELOCATABLE