Remove unreachable logic after error(...) is called. #1369

Merged
merged 2 commits into from Mar 21, 2012

Projects

None yet

3 participants

@kkujala
Contributor
kkujala commented Mar 20, 2012

The function error(...) always throws so there is no need to return separately
or have an else branch.

@kkujala kkujala Remove unreachable logic after error(...) is called.
The function error(...) always throws so there is no need to return separately
or have an else branch.
eb4ec78
@notmasteryet notmasteryet and 1 other commented on an outdated diff Mar 20, 2012
error('Invalid font name(s): ' + names.join());
- return; // Keep the return in case if error() did not throw.
@notmasteryet
notmasteryet Mar 20, 2012 Contributor

keep this one here: error function can be intercepted by malicious code to not throw. or change error to throw here

@kkujala
kkujala Mar 20, 2012 Contributor

I could document the reasoning for the return. I was unaware of the malicious code possibility.

@notmasteryet
Contributor

@pdfjsbot test

@pdfjsbot
Collaborator

Processing command test by user notmasteryet. Queue size: 0

Live script output is available (after queueing is done) at: http://184.73.87.52:8989/4610205.txt

[bot:processed:4610205]

@pdfjsbot
Collaborator

All tests passed.

Output:

========== Killing any stray processes

========== Running garbage collector in /mnt/pdfjsbot-tmp
Collecting garbage...

========== Cloning pull request repo
Cloning into ....

========== Merging upstream into pull request clone

========== Running 'make lint'
gjslint --nojsdoc  src/bidi.js src/canvas.js src/charsets.js src/cidmaps.js src/colorspace.js src/core.js src/crypto.js src/evaluator.js src/fonts.js src/function.js src/glyphlist.js src/image.js src/jpx.js src/metrics.js src/obj.js src/parser.js src/pattern.js src/pdf.js src/stream.js src/util.js src/worker.js src/worker_loader.js    web/compatibility.js web/debugger.js web/viewer.js  test/driver.js  examples/helloworld/hello.js  extensions/firefox/bootstrap.js  extensions/firefox/components/PdfStreamConverter.js    test/unit/crypto_spec.js test/unit/function_spec.js test/unit/obj_spec.js test/unit/stream_spec.js
33 files checked, no errors found.

========== Cloning reference images repo into test/ref/
Initialized empty Git repository in /mnt/pdfjsbot-tmp/tests/ed2bcf0ffa25dbd470d817ef8cc7118bb83f5978/test/ref/.git/

========== Checking for consistency with reference repo

========== Running 'make bot_test'
Xvfb: no process found
cd test; \
    python -u test.py \
    --browserManifestFile=resources/browser_manifests/browser_manifest.json \
    --manifestFile=test_manifest.json
Launching firefox
Launching chrome
TEST-PASS | eq test tracemonkey-eq | in chrome
TEST-PASS | eq test tracemonkey-eq | in firefox
TEST-PASS | forward-back-forward test tracemonkey-fbf | in chrome
TEST-PASS | load test html5-canvas-cheat-sheet-load | in chrome
TEST-PASS | forward-back-forward test tracemonkey-fbf | in firefox
TEST-PASS | load test html5-canvas-cheat-sheet-load | in firefox
TEST-PASS | eq test intelisa-eq | in chrome
TEST-PASS | eq test intelisa-eq | in firefox
TEST-PASS | load test pdfspec-load | in chrome
TEST-PASS | load test shavian-load | in chrome
TEST-PASS | eq test sizes | in chrome
TEST-PASS | eq test plusminus | in chrome
TEST-PASS | load test openoffice-pdf | in chrome
TEST-PASS | load test openofficecidtruetype-pdf | in chrome
TEST-PASS | load test openofficearabiccidtruetype-pdf | in chrome
TEST-PASS | load test arabiccidtruetype-pdf | in chrome
TEST-PASS | load test complexttffont-pdf | in chrome
TEST-PASS | eq test thuluthfont-pdf | in chrome
TEST-PASS | eq test freeculture | in chrome
TEST-PASS | eq test wnv_chinese-pdf | in chrome
TEST-PASS | eq test i9-pdf | in chrome
TEST-PASS | load test hmm-pdf | in chrome
TEST-PASS | eq test rotation | in chrome
TEST-PASS | load test ecma262-pdf | in chrome
TEST-PASS | load test jai-pdf | in chrome
TEST-PASS | eq test cable | in chrome
TEST-PASS | eq test pdkids | in chrome
TEST-PASS | eq test artofwar | in chrome
TEST-PASS | eq test wdsg_fitc | in chrome
TEST-PASS | eq test unix01 | in chrome
TEST-PASS | load test pdfspec-load | in firefox
TEST-PASS | load test shavian-load | in firefox
TEST-PASS | eq test sizes | in firefox
TEST-PASS | eq test plusminus | in firefox
TEST-PASS | load test openoffice-pdf | in firefox
TEST-PASS | load test openofficecidtruetype-pdf | in firefox
TEST-PASS | load test openofficearabiccidtruetype-pdf | in firefox
TEST-PASS | load test arabiccidtruetype-pdf | in firefox
TEST-PASS | load test complexttffont-pdf | in firefox
TEST-PASS | eq test thuluthfont-pdf | in firefox
TEST-PASS | eq test freeculture | in firefox
TEST-PASS | eq test wnv_chinese-pdf | in firefox
TEST-PASS | eq test i9-pdf | in firefox
TEST-PASS | eq test fit11-talk | in chrome
TEST-PASS | load test hmm-pdf | in firefox
TEST-PASS | eq test rotation | in firefox
TEST-PASS | eq test fips197 | in chrome
TEST-PASS | load test txt2pdf | in chrome
TEST-PASS | load test f1040 | in chrome
TEST-PASS | load test hudsonsurvey | in chrome
TEST-PASS | eq test extgstate | in chrome
TEST-PASS | eq test usmanm-bad | in chrome
TEST-PASS | load test vesta-bad | in chrome
TEST-PASS | load test scan-bad | in chrome
TEST-PASS | load test ibwa-bad | in chrome
TEST-PASS | eq test tcpdf_033 | in chrome
TEST-PASS | eq test pal-o47 | in chrome
TEST-PASS | eq test simpletype3font | in chrome
TEST-PASS | eq test close-path-bug | in chrome
TEST-PASS | eq test alphatrans | in chrome
TEST-PASS | eq test devicen | in chrome
TEST-PASS | eq test cmykjpeg | in chrome
TEST-PASS | eq test protectip | in chrome
TEST-PASS | eq test piperine | in chrome
TEST-PASS | eq test issue840 | in chrome
TEST-PASS | eq test bpl13210 | in chrome
TEST-PASS | eq test tutorial | in chrome
TEST-PASS | eq test geothermal.pdf | in chrome
TEST-PASS | eq test lista_preliminar | in chrome
TEST-PASS | eq test issue919 | in chrome
TEST-PASS | eq test issue918 | in chrome
TEST-PASS | eq test issue1001 | in chrome
TEST-PASS | eq test aboutstacks | in chrome
TEST-PASS | eq test smaskdim | in chrome
TEST-PASS | eq test type4psfunc | in chrome
TEST-PASS | load test ocs | in chrome
TEST-PASS | eq test issue1010 | in chrome
TEST-PASS | load test ecma262-pdf | in firefox
TEST-PASS | eq test issue1015 | in chrome
TEST-PASS | eq test issue1096 | in chrome
TEST-PASS | eq test issue1127 | in chrome
TEST-PASS | load test issue1249-load | in chrome
TEST-PASS | load test liveprogramming | in chrome
TEST-PASS | eq test S2-eq | in chrome
TEST-PASS | eq test issue1055 | in chrome
TEST-PASS | eq test issue1169 | in chrome
TEST-PASS | eq test zerowidthline | in chrome
TEST-PASS | eq test html5checker | in chrome
TEST-PASS | eq test pdfkit_compressed | in chrome
TEST-PASS | eq test tamreview | in chrome
TEST-PASS | eq test issue925 | in chrome
TEST-PASS | eq test issue1133 | in chrome
TEST-PASS | eq test issue1049 | in chrome
TEST-PASS | eq test issue1155 | in chrome
TEST-PASS | eq test issue1243 | in chrome
TEST-PASS | eq test issue1257 | in chrome
TEST-PASS | load test jai-pdf | in firefox
TEST-PASS | eq test cable | in firefox
TEST-PASS | eq test pdkids | in firefox
TEST-PASS | eq test artofwar | in firefox
TEST-PASS | eq test wdsg_fitc | in firefox
TEST-PASS | eq test unix01 | in firefox
TEST-PASS | eq test fit11-talk | in firefox
TEST-PASS | eq test fips197 | in firefox
TEST-PASS | load test txt2pdf | in firefox
TEST-PASS | load test f1040 | in firefox
TEST-PASS | load test hudsonsurvey | in firefox
TEST-PASS | eq test extgstate | in firefox
TEST-PASS | eq test usmanm-bad | in firefox
TEST-PASS | load test vesta-bad | in firefox
TEST-PASS | load test scan-bad | in firefox
TEST-PASS | load test ibwa-bad | in firefox
TEST-PASS | eq test tcpdf_033 | in firefox
TEST-PASS | eq test pal-o47 | in firefox
TEST-PASS | eq test simpletype3font | in firefox
TEST-PASS | eq test close-path-bug | in firefox
TEST-PASS | eq test alphatrans | in firefox
TEST-PASS | eq test devicen | in firefox
TEST-PASS | eq test cmykjpeg | in firefox
TEST-PASS | eq test protectip | in firefox
TEST-PASS | eq test piperine | in firefox
TEST-PASS | eq test issue840 | in firefox
TEST-PASS | eq test bpl13210 | in firefox
TEST-PASS | eq test tutorial | in firefox
TEST-PASS | eq test geothermal.pdf | in firefox
TEST-PASS | eq test lista_preliminar | in firefox
TEST-PASS | eq test issue919 | in firefox
TEST-PASS | eq test issue918 | in firefox
TEST-PASS | eq test issue1001 | in firefox
TEST-PASS | eq test aboutstacks | in firefox
TEST-PASS | eq test smaskdim | in firefox
TEST-PASS | eq test type4psfunc | in firefox
TEST-PASS | load test ocs | in firefox
TEST-PASS | eq test issue1010 | in firefox
TEST-PASS | eq test issue1015 | in firefox
TEST-PASS | eq test issue1096 | in firefox
TEST-PASS | eq test issue1127 | in firefox
TEST-PASS | load test issue1249-load | in firefox
TEST-PASS | load test liveprogramming | in firefox
TEST-PASS | eq test S2-eq | in firefox
TEST-PASS | eq test issue1055 | in firefox
TEST-PASS | eq test issue1169 | in firefox
TEST-PASS | eq test zerowidthline | in firefox
TEST-PASS | eq test html5checker | in firefox
TEST-PASS | eq test pdfkit_compressed | in firefox
TEST-PASS | eq test tamreview | in firefox
TEST-PASS | eq test issue925 | in firefox
TEST-PASS | eq test issue1133 | in firefox
TEST-PASS | eq test issue1049 | in firefox
TEST-PASS | eq test issue1155 | in firefox
TEST-PASS | eq test issue1243 | in firefox
TEST-PASS | eq test issue1257 | in firefox

All tests passed.
Process firefox is still running. Killing.
Runtime was 1416 seconds
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
  File "/usr/lib/python2.7/threading.py", line 505, in run
  File "/usr/lib/python2.7/SocketServer.py", line 225, in serve_forever
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'select'

========== Cleaning up
./run-test: line 206:   614 Killed                  Xvfb :1 -screen 0 1280x1024x24 > /dev/null 2> /dev/null

All done.


_____________________________ stderr:

Bot response time: 24.78 mins

@notmasteryet notmasteryet merged commit 8ee818e into mozilla:master Mar 21, 2012
@notmasteryet
Contributor

Thank you for the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment