Commit graph

66 commits

Author SHA1 Message Date
DeeDeeG
00a5cf436b test: Update require()s ('src/' --> 'lib/') 2020-12-13 20:34:00 -05:00
Amin Yahyaabadi
1be7c8f943 remove the old tests the checks for error throwning 2020-07-06 02:39:38 -05:00
Amin Yahyaabadi
a7a8d4e1f4 test for assigning to module or exports 2020-07-06 02:39:37 -05:00
Amin Yahyaabadi
1cff5b1c6c tests for using reference directly 2020-07-06 02:21:21 -05:00
Amin Yahyaabadi
4aeac04ad6 update mocha 2020-06-29 17:29:07 -05:00
Ash Wilson
1f63dcb4c9
Change name of spec
Co-Authored-By: rafeca <rafeca@gmail.com>
2019-04-25 15:41:30 +02:00
Rafael Oleza
08aec63b89 Use acorn for JS parsing
This allows electron-link to handle code with ecmaScipt 9th edition features.
2019-04-25 13:14:05 +02:00
Ash Wilson
879e01be46
Bump expected line numbers in test 2019-02-04 13:28:51 -05:00
Ash Wilson
7e61f21a03
Revert "Revert "Merge pull request #14 from atom/aw/trick-feature-probe""
This reverts commit 297d527bd2.
2018-12-21 17:36:03 -05:00
Ash Wilson
297d527bd2
Revert "Merge pull request #14 from atom/aw/trick-feature-probe"
This reverts commit 2354fe705a, reversing
changes made to 0dc9eb2c4c.
2018-12-21 17:35:15 -05:00
Ash Wilson
4e7ab34043
Update translated rows 2018-12-20 12:39:49 -05:00
Ash Wilson
f8a295496d
Update rows in linked file 2018-12-19 20:42:01 -05:00
Ash Wilson
ec6fa283d9
Update verification script 2018-12-19 15:53:36 -05:00
Ash Wilson
cd08ce0201
Samples that demonstrate the resolved issue 2018-12-19 13:56:39 -05:00
Antonio Scandurra
1ca1396135 Provide requiringModulePath in addition to requiredModulePath
This will allow to exclude all the modules required from a particular
file.
2018-03-13 10:00:56 +01:00
Antonio Scandurra
16be9d7276 Return includedFilePaths when generating snapshot script 2017-12-22 17:01:16 +01:00
Antonio Scandurra
e40c54c08a Replace source maps with a more compact representation
This adds the `translateSnapshotRow` method to the global
`snapshotResult` variable and can be used to translate a line number in
the snapshot script to a relative line number in an embedded source
file.

Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-19 09:52:47 +02:00
Antonio Scandurra
556d13fdf8 Put sourceMap inside snapshotAuxiliaryData instead of snapshotResult
Signed-off-by: Michelle Tilley <binarymuse@github.com>
2017-05-11 13:54:54 +02:00
Antonio Scandurra
062ff59d71 Replace usages of console with get_console() 2017-04-04 11:29:38 +02:00
Antonio Scandurra
d2114cc32c Improve error message when using Node's require before calling setGlobals 2017-03-22 15:35:31 +01:00
Antonio Scandurra
d89858daf6 Embed source maps into the snapshot 2017-03-17 13:13:18 +01:00
Antonio Scandurra
db48bf7abf Generate source maps 2017-03-17 10:54:34 +01:00
Antonio Scandurra
78474dbe1f Add snapshotResult.translateLineNumber
This new facility will allow to convert an absolute line number in the
generated snapshot script to the line number relative to the file whose
contents have been snapshotted.
2017-03-16 18:09:16 +01:00
Antonio Scandurra
2e2c3f8e8d Allow to use auxiliary data while inside mksnapshot 2017-03-09 11:53:38 +01:00
Antonio Scandurra
c8ec826fab Support loading auxiliary data into the snapshot 2017-03-09 10:26:04 +01:00
Antonio Scandurra
bb3d9fbef8 Ensure cyclic requires work when using Node's require 2017-03-06 19:53:35 +01:00
Antonio Scandurra
4a624600a9 Support cyclic requires
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-03-06 18:18:42 +01:00
Antonio Scandurra
1d9f14596c Use the shouldExcludeModule callback as an invalidation key 2017-03-02 09:45:53 +01:00
Antonio Scandurra
2167a49600 Assign the current platform to process.platform 2017-02-27 16:55:28 +01:00
Antonio Scandurra
7b5f256f25 Add tests for node requires 2017-02-27 16:36:52 +01:00
Antonio Scandurra
b2cafec2b6 Delete unused entries from cache 2017-02-27 13:52:31 +01:00
Antonio Scandurra
0dc39a3731 Include also filePath in the cache key 2017-02-27 09:31:32 +01:00
Antonio Scandurra
2185fa9ec3 Add caching 2017-02-26 10:55:23 +01:00
Antonio Scandurra
a0ac74baa9 Report both unresolved and resolved module paths 2017-02-26 10:21:26 +01:00
Antonio Scandurra
1d47b4d847 Use strings instead of ASTs to generate a snapshot from the blueprint 2017-02-25 19:33:03 +01:00
Antonio Scandurra
f88b0fcfe2 Refactor processRequires function into FileRequireTransform object 2017-02-25 11:15:28 +01:00
Antonio Scandurra
d73eae6931 Process global references last 2017-02-25 10:20:49 +01:00
Antonio Scandurra
6299f290e1 Always defer require for node core modules 2017-02-24 09:10:18 +01:00
Antonio Scandurra
f68d611f34 Support requires with destructuring assignments 2017-02-23 11:08:22 +01:00
Antonio Scandurra
5ce7c953c0 Bind this to module.exports when evaluating require definitions 2016-11-16 11:10:20 +01:00
Antonio Scandurra
25b3e18b57 Handle requires appearing in a top-level conditional 2016-11-16 11:02:22 +01:00
Antonio Scandurra
f0eafe291d Provide a document global 2016-11-16 11:02:07 +01:00
Antonio Scandurra
cdd162eb44 🔥 2016-11-16 08:47:37 +01:00
Antonio Scandurra
cedb422657 Don't consider functions as top-level if used as arguments in top-level calls 2016-11-15 17:12:51 +01:00
Antonio Scandurra
22e8e1f075 Support more complex require assignments 2016-11-15 16:30:58 +01:00
Antonio Scandurra
f3f74387aa Defer references to global objects 2016-11-15 15:05:03 +01:00
Antonio Scandurra
3b7de255db Re-relativize paths found in require.resolve calls 2016-11-14 14:47:41 +01:00
Antonio Scandurra
7e5b76fcf4 Fix transformation for top-level usages of _asyncToGenerator 2016-11-14 10:40:54 +01:00
Antonio Scandurra
7e432339a5 Don't relativize path for core node modules 2016-11-11 15:33:01 +01:00
Antonio Scandurra
955a7a34c6 Handle all kinds of closure wrappers
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-11-10 19:41:32 +01:00