From 51d0808c908f33db34382024b8011d27e0943fa7 Mon Sep 17 00:00:00 2001 From: Yazhong Liu Date: Fri, 3 Oct 2014 00:00:40 +0800 Subject: [PATCH 1/2] stream: remove duplicated expression PR-URL: https://github.com/iojs/io.js/pull/1444 Reviewed-By: Trevor Norris Reviewed-By: Chris Dickinson Reviewed-By: Jeremiah Senkpiel --- lib/_stream_readable.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 5600218523b6f9..1de55597123d1b 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -125,8 +125,7 @@ function readableAddChunk(stream, state, chunk, encoding, addToFront) { stream.emit('error', er); } else if (chunk === null) { state.reading = false; - if (!state.ended) - onEofChunk(stream, state); + onEofChunk(stream, state); } else if (state.objectMode || chunk && chunk.length > 0) { if (state.ended && !addToFront) { var e = new Error('stream.push() after EOF'); @@ -372,7 +371,8 @@ function chunkInvalid(state, chunk) { function onEofChunk(stream, state) { - if (state.decoder && !state.ended) { + if (state.ended) return; + if (state.decoder) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); From 91943a99d534e67f6b7a7a3be45206afdb3fbf75 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Thu, 16 Oct 2014 15:40:52 +1100 Subject: [PATCH 2/2] build: use %PYTHON% instead of python Like libuv does. Originally: https://github.com/node-forward/node/pull/21 PR-URL: https://github.com/iojs/io.js/pull/1444 Reviewed-By: Ben Noordhuis Reviewed-By: Jeremiah Senkpiel Conflicts: vcbuild.bat --- vcbuild.bat | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/vcbuild.bat b/vcbuild.bat index 44d149d32241b4..2de38fea9660cb 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -89,10 +89,12 @@ if defined noprojgen goto msbuild if defined NIGHTLY set TAG=nightly-%NIGHTLY% +if not defined PYTHON set PYTHON=python + @rem Generate the VS project. SETLOCAL if defined VS100COMNTOOLS call "%VS100COMNTOOLS%\VCVarsQueryRegistry.bat" - python configure %download_arg% %i18n_arg% %debug_arg% %snapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch% --tag=%TAG% + "%PYTHON%" configure %download_arg% %i18n_arg% %debug_arg% %snapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch% --tag=%TAG% if errorlevel 1 goto create-msvs-files-failed if not exist node.sln goto create-msvs-files-failed echo Project files generated. @@ -174,14 +176,14 @@ if "%config%"=="Release" set test_args=--mode=release %test_args% echo running 'cctest' "%config%\cctest" echo running 'python tools/test.py %test_args%' -python tools/test.py %test_args% +"%PYTHON%" tools/test.py %test_args% goto jslint :jslint if not defined jslint goto exit echo running jslint set PYTHONPATH=tools/closure_linter/;tools/gflags/ -python tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js +"%PYTHON%" tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js goto exit :create-msvs-files-failed @@ -206,6 +208,6 @@ rem *************** :getnodeversion set NODE_VERSION= -for /F "usebackq tokens=*" %%i in (`python "%~dp0tools\getnodeversion.py"`) do set NODE_VERSION=%%i +for /F "usebackq tokens=*" %%i in (`"%PYTHON%" "%~dp0tools\getnodeversion.py"`) do set NODE_VERSION=%%i if not defined NODE_VERSION echo Cannot determine current version of io.js & exit /b 1 goto :EOF