Even though the blanket shebang ignore is a blunt instrument, it does replicate node's behavior, ...
13 years, 2 months ago
(2013-03-21 15:46:43 UTC)
#1
Even though the blanket shebang ignore is a blunt instrument, it does
replicate node's behavior, so it's probably a feature, not a bug.
#--cut--
git checkout 60408908bf3c682b # last merge with branch master
dl_check() {
local f=$(basename $1)
test -e $f || curl -sO $1
openssl sha1 < $f | grep -q "= $2" && return 0
echo sha1 mismatch!
return 1
}
git checkout -b issue7945043-handle-shebang
dl_check https://codereview.appspot.com/download/issue7945043_1.diff \
1fbfff451b022bd8 && git apply issue7945043_1.diff && make test
cat > shebang-test.js <<"END"
#!./traceur
console.log(`Hello ${'she'}bang`);
END
chmod +x shebang-test.js
./shebang-test.js
#--cut--
https://codereview.appspot.com/7945043/diff/1/src/node/inline-module.js
File src/node/inline-module.js (right):
https://codereview.appspot.com/7945043/diff/1/src/node/inline-module.js#newco...
src/node/inline-module.js:137: data = '//' + data;
It's not as elegant as removing, but it's by far the simplest solution
that maintains line numbering while also handling odd cases like files
that contain only a shebang line that does not end in a newline.
LGTM FYI, if you "npm install -g" you can do #!/usr/bin/env traceur https://codereview.appspot.com/7945043/diff/1/src/node/inline-module.js File src/node/inline-module.js ...
13 years, 2 months ago
(2013-03-21 16:16:13 UTC)
#2
Issue 7945043: Make 'traceur' ignore shebang lines in files.
(Closed)
Created 13 years, 2 months ago by usrbincc
Modified 13 years, 2 months ago
Reviewers: arv, slightlylate
Base URL: https://code.google.com/p/traceur-compiler/@master
Comments: 2