Repro: 1. Create test.js: > print(function foo() { > }); 2. Run it (with WinCairo JSC) and view output with explicit carriage returns: > jsc.exe test.js | cat -v 3. Notice that carriage returns inside the function are doubled: > function fn() {^M^M > }^M --- Notes: - This results in various test failures under the ChakraCore/test directory: Basics/with3.js.default Closures/closure-funcexpr-eval.js.default Function/CallerArgs.js.default Function/funcExpr.js.default Function/moreFuncExpr.js.default Function/stackargs.js.default Function/toString.js.default LetConst/l.js.default strict/05.arguments.js.default - It appears that read/readFile also produce CRCRLF in function bodies; perhaps this is why there aren't even more failures (e.g. stress/jsc-read.js).
Created attachment 351553 [details] Patch
Comment on attachment 351553 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=351553&action=review > Source/JavaScriptCore/jsc.cpp:2236 > + _setmode(1, _O_BINARY); > + _setmode(2, _O_BINARY); Would it be possible to use _fileno(stdout) and _fileno(stderr) instead? I think that those documents the intent better than 1 and 2.
Created attachment 351555 [details] Patch
Comment on attachment 351555 [details] Patch r=me if the EWS bots are green.
Comment on attachment 351555 [details] Patch Clearing flags on attachment: 351555 Committed r236827: <https://trac.webkit.org/changeset/236827>
All reviewed patches have been landed. Closing bug.
<rdar://problem/44998734>