Commit Graph

9734 Commits

Author SHA1 Message Date
Yury Delendik
deae2d8cb8 Merge pull request #8368 from yurydelendik/sourcemap
Enables source maps for webpack generated files.
2017-05-05 09:32:27 -05:00
Yury Delendik
996805f953 Produces source maps for built files. 2017-05-05 08:15:21 -05:00
Yury Delendik
c3cfcbe72f Merge pull request #8340 from ydfzgyj/fix-svg-spacing
Fix char spacing bug in SVG mode
2017-05-05 07:41:25 -05:00
巴里切罗
d58040aa29 fix(svg) char spacing bug 2017-05-05 12:11:20 +08:00
Yury Delendik
206ad8d8b2 Merge pull request #8378 from Snuffleupagus/es6-modules-src-shared
Convert the files in the `/src/shared` folder to ES6 modules
2017-05-04 14:35:09 -05:00
Jonas Jenwald
60b14f526e Convert the files in the /src/shared folder to ES6 modules 2017-05-04 21:07:59 +02:00
Yury Delendik
b0a796ced3 Merge pull request #8377 from Snuffleupagus/web-rm-bind
Replace unnecessary `bind(this)` statements with arrow functions in `web/` files
2017-05-04 12:08:05 -05:00
Jonas Jenwald
f27b5013e2 Replace unnecessary bind(this) statements with arrow functions in web/ files
By using `let`, which is block-scoped, instead of `var` in a couple of places we're able to get rid of additional `bind` calls.
2017-05-04 17:13:09 +02:00
Yury Delendik
c9d3c20e2c Fix esprima tests. 2017-05-04 08:24:44 -05:00
Yury Delendik
3adda80f97 Merge pull request #8358 from Snuffleupagus/PartialEvaluator-method-signatures
Change the signatures of the `PartialEvaluator` "constructor" and its `getOperatorList`/`getTextContent` methods to take parameter objects
2017-05-04 08:10:30 -05:00
Yury Delendik
e81c067de2 Merge pull request #8370 from Snuffleupagus/src-rm-bind
Replace unnecessary `bind(this)` and `var self = this` statements with arrow functions in remaining `src/` files
2017-05-03 18:00:34 -05:00
Jonas Jenwald
6c81b8e6dd Replace unnecessary bind(this) and var self = this statements with arrow functions in remaining src/ files 2017-05-03 23:12:35 +02:00
Yury Delendik
e42fc546a0 Merge pull request #8369 from mozilla/brendandahl-patch-1
Add no-default-browser-check to chrome runner.
2017-05-03 13:44:19 -05:00
Brendan Dahl
b06022895e Add no-default-browser-check to chrome runner. 2017-05-03 11:22:08 -07:00
Yury Delendik
74ba3033e8 Merge pull request #8359 from Snuffleupagus/Lexer-getNumber-ignore-line-breaks
Ignore line-breaks between operator and digit in `Lexer.getNumber`
2017-05-03 09:43:59 -05:00
Yury Delendik
2ac410625b Fixes shell parameters quoting after #8349 2017-05-03 08:17:31 -05:00
Jonas Jenwald
b4787f0d38 Merge pull request #8364 from yurydelendik/babel-cache
Adds babel caching for system.js.
2017-05-03 13:05:39 +02:00
Jonas Jenwald
3e20d30afc Change the signatures of the PartialEvaluator "constructor" and its getOperatorList/getTextContent methods to take parameter objects
Currently these methods accept a large number of parameters, which creates quite unwieldy call-sites. When invoking them, you have to remember not only what arguments to supply, but also the correct order, to avoid runtime errors.
Furthermore, since some of the parameters are optional, you also have to remember to pass e.g. `null` or `undefined` for those ones.
Also, adding new parameters to these methods (which happens occasionally), often becomes unnecessarily tedious (based on personal experience).

Please note that I do *not* think that we need/should convert *every* single method in `evaluator.js` (or elsewhere in `/core` files) to take parameter objects. However, in my opinion, once a method starts relying on approximately five parameter (or even more), passing them in individually becomes quite cumbersome.

With these changes, I obviously needed to update the `evaluator_spec.js` unit-tests. The main change there, except the new method signatures[1], is that it's now re-using *one* `PartialEvalutor` instance, since I couldn't see any compelling reason for creating a new one in every single test.

*Note:* If this patch is accepted, my intention is to (time permitting) see if it makes sense to convert additional methods in `evaluator.js` (and other `/core` files) in a similar fashion, but I figured that it'd be a good idea to limit the initial scope somewhat.

---

[1] A fun fact here, note how the `PartialEvaluator` signature used in `evaluator_spec.js` wasn't even correct in the current `master`.
2017-05-03 12:10:20 +02:00
Yury Delendik
bbb2cc000e Adds babel caching for system.js. 2017-05-02 19:28:03 -05:00
Yury Delendik
84f174bb2f Merge pull request #8363 from yurydelendik/worker-fromport
Adds initializeFromPort to the WorkerMessageHandler.
2017-05-02 19:22:20 -05:00
Yury Delendik
008aa56ac6 Adds initializeFromPort to the WorkerMessageHandler. 2017-05-02 16:11:54 -05:00
Jonas Jenwald
40feca12c1 Ignore line-breaks between operator and digit in Lexer.getNumber
This is consistent with the behaviour in Adobe Reader (and PDFium), and it fixes the display of page 30 in https://bug1354114.bmoattachments.org/attachment.cgi?id=8855457 (taken from https://bugzilla.mozilla.org/show_bug.cgi?id=1354114).

The patch also makes the `error` message for invalid numbers slightly more useful, by including the charCode as well. (Having that information available would have reduced the time spent on debugging the PDF file above.)
2017-05-02 20:59:42 +02:00
Yury Delendik
aea3eccd0f Merge pull request #8361 from tobytailor/master
Export LoopbackPort
2017-05-02 13:51:57 -05:00
Tobias Schneider
a80c405941 Rename FakeWorkerPort to LoopbackPort and export it 2017-05-02 11:33:19 -07:00
Yury Delendik
de7002dc6c Merge pull request #8357 from Snuffleupagus/core-rm-bind
Replace unnecessary `bind(this)` and `var self = this` statements with arrow functions in remaining `src/core/` files
2017-05-02 10:11:02 -05:00
Jonas Jenwald
ebaa22478c Replace unnecessary bind(this) and var self = this statements with arrow functions in remaining src/core/ files 2017-05-02 15:47:43 +02:00
Tim van der Meij
0c99429291 Merge pull request #8349 from timvandermeij/remove-make
Migrate `make.js` to `gulpfile.js`
2017-05-02 01:12:56 +02:00
Tim van der Meij
f748407b26
Remove make.js and the target fetching in gulpfile.js
Note that we have to use `fs.writeFileSync` since `.to()` is not
available anymore. Moreover, introduce `safeSpawnSync` to make sure that
we check the return codes of the spawned processes properly.
2017-05-02 01:00:52 +02:00
Tim van der Meij
145c0cea39
Remove unused Gulp target for testing
To run the regression tests, developers use `gulp browsertest` and the
bot uses `gulp bottest`. We're not passing the `noreftest` option
anywhere in the code (probably because the `bottest` command takes care
of this already), so we should remove this.
2017-05-02 00:47:53 +02:00
Tim van der Meij
19cc9bcded
Port the mozcentraldiff target to Gulp 2017-05-02 00:47:51 +02:00
Tim van der Meij
74854fb4cc
Port the mozcentralbaseline target to Gulp
The baseline fix is dead code since three years, so we can safely remove
it.
2017-05-02 00:45:52 +02:00
Tim van der Meij
e18a08ffeb Merge pull request #8355 from Snuffleupagus/evaluator-rm-bind
Replace unnecessary `bind(this)` and `var self = this` statements with arrow functions in `src/core/evaluator.js`
2017-05-01 23:41:06 +02:00
Jonas Jenwald
95bbc8101c Replace unnecessary bind(this) and var self = this statements with arrow functions in src/core/evaluator.js
Note that by using `let` instead of `var` in `PartialEvaluator.setGState` and `TranslatedFont.loadType3Data`, we can get rid of further `bind` usages since `let` is block-scoped.
Also, the fact that `bind` wasn't used in the `Font` case inside of `setGState` is actually a bug which has been present ever since PR 5205, where a closure was replaced by a standard loop.[1]

---
[1] I'm not aware of any bugs caused by this, but that is probably more a happy accident than anything else, since e.g. just removing the `bind` from the `SMask` case without using block-scoped variables causes test failures.
2017-05-01 20:29:44 +02:00
Tim van der Meij
60c232bc8c Merge pull request #8353 from Snuffleupagus/eslint_object-shorthand
Enable the `object-shorthand` ESLint rule
2017-04-30 21:23:57 +02:00
Tim van der Meij
456b1566cb Merge pull request #8354 from Snuffleupagus/PdfStreamConverter-remove-bind
[Firefox addon] Replace a `bind(this)` statement with an arrow function in `PdfStreamConverter.jsm` (issue 8343)
2017-04-30 21:10:53 +02:00
Jonas Jenwald
8e976d7110 [Firefox addon] Replace a bind(this) statement with an arrow function in PdfStreamConverter.jsm (issue 8343)
Please note that I used the addon debugger to set a breakpoint in the `unload` function, in order to ensure that `this` still correctly refers to the `FindEventManager` scope.
2017-04-30 13:26:34 +02:00
Jonas Jenwald
7560f12a17 Enable the object-shorthand ESLint rule
Please see http://eslint.org/docs/rules/object-shorthand.

Unfortunately, based on commit 9276d1dcd9, it seems that we still need to maintain compatibility with old Node.js versions, hence certain files/directories that are executed in Node.js are currently exempt from this rule.

Furthermore, since the files specific to the Chromium extension are not run through Babel, the `/extensions/chromium/` directory is also exempt from this rule.
2017-04-30 11:13:34 +02:00
Jonas Jenwald
00d67371ec Merge pull request #8298 from timvandermeij/es6-modules-test
Convert the files in the `/test/unit` folder to ES6 modules
2017-04-30 10:34:48 +02:00
Tim van der Meij
35730148a7
Convert the files in the /test/unit folder to ES6 modules 2017-04-30 00:34:02 +02:00
Tim van der Meij
06c93d8fbd Merge pull request #8342 from Snuffleupagus/eslint_object-shorthand-src-core
Enable the `object-shorthand` ESLint rule in `src/core`
2017-04-29 23:59:20 +02:00
Tim van der Meij
5fb779d26f Merge pull request #8351 from Snuffleupagus/eslint_object-shorthand-web
Enable the `object-shorthand` ESLint rule in `web`
2017-04-29 23:49:33 +02:00
Jonas Jenwald
2a0207ccaf Enable the object-shorthand ESLint rule in web
Please see http://eslint.org/docs/rules/object-shorthand.

For the most part, these changes are of the search-and-replace kind, and the previously enabled `no-undef` rule should complement the tests in helping ensure that no stupid errors crept into to the patch.
2017-04-29 20:29:04 +02:00
Jonas Jenwald
165294a05f Merge pull request #8335 from Snuffleupagus/jbig2-decodeRefinement-subtract-offsets
Subtract the X/Y offsets when decoding refinement regions of JBIG2 images (issue 7145, 7308, 7401, 7850, 8270)
2017-04-28 23:13:07 +02:00
Jonas Jenwald
8defde508a Merge pull request #8352 from yurydelendik/rm-builderbuild
Removes builder.build().
2017-04-28 20:41:11 +02:00
Yury Delendik
140dd0f15b Removes builder.build(). 2017-04-28 12:47:20 -05:00
Yury Delendik
9276d1dcd9 Allow older versions on node.js to run gulpfile. 2017-04-28 09:20:21 -05:00
Yury Delendik
71bbcfad8a Merge pull request #8309 from vologab/feature/allow_query_string_for_pdfjs
Allow use versions for pdf.js script (i.e. - pdf.js?2412313)
2017-04-27 19:00:43 -05:00
Tim van der Meij
499c605b32 Merge pull request #8348 from Snuffleupagus/README.mozilla-commit
Add the commit hash to the `README.mozilla` file (issue 8347)
2017-04-27 23:24:41 +02:00
Jonas Jenwald
b3582ccbad Add the commit hash to the README.mozilla file (issue 8347) 2017-04-27 23:01:22 +02:00
Yury Delendik
7fd2084796 Merge pull request #8346 from Snuffleupagus/issue-8344
Restore the `URL.createObjectURL` check to the `createObjectURL` utility function (issue 8344)
2017-04-27 15:42:53 -05:00