Commit Graph

85 Commits

Author SHA1 Message Date
Jason Rudolph
db88a07e8c Fix test failure re: "Module._cache.hasOwnProperty is not a function"
Example build failure:
https://ci.appveyor.com/project/Atom/atom/build/job/fvtxos5ys6a5lek1#L634

As of Node 8.0.0, Module._cache.hasOwnProperty is no longer a function:
403b89e72b
2018-05-04 14:24:57 -04:00
Antonio Scandurra
9b8c7973d7 WIP 2017-02-28 09:34:55 +01:00
Machiste Quintana
ab9a2a92c8 Rewrite exports/atom.coffee as JS 2016-08-06 17:20:46 -07:00
Wliu
3e507e1157 atom.asar -> electron.asar 2016-05-02 14:27:42 +00:00
Wliu
09b88cd1d5 Fix defective spec and associate 'screen' as a renderer module 2016-04-14 14:11:25 +00:00
Wliu
2a9bc0fa12 Actually fix require paths 2016-04-12 17:08:01 -04:00
Wliu
8694ea3c94 Update require paths for deprecated Electron syntax 2016-04-01 22:21:39 -04:00
Wliu
6cd480b37e Fix Electron deprecations 2015-11-17 21:16:09 -05:00
Cheng Zhao
3c0e4511fc Built-in modules' code are now in asar archive 2015-03-05 15:01:10 -08:00
Kevin Sawicki
97e0ddf15d Null out mainPath on resolve errors
The scope of this variable is outside the loop so this prevent
cache corruption based on using the mainPath value from previous
module.

Refs atom/atom-space-pen-views#5
2015-01-07 10:53:33 -08:00
Kevin Sawicki
0c590d6170 Load CoffeeScript when using a custom resource path
Load CoffeeScript early whenever the resource path a subdirectory
from process.resourcesPath

Close #3993
2014-10-29 10:21:23 -07:00
Kevin Sawicki
f33d7ba27f 📝 store -> stored 2014-10-21 13:28:09 -07:00
Kevin Sawicki
345c0f670c Ignore extensions from bundled packages
These are generated in their own cache
2014-10-21 13:28:08 -07:00
Kevin Sawicki
8479d564f5 Enable extensions for installed packages 2014-10-21 11:02:24 -07:00
Kevin Sawicki
ec6004615a Load extensions in ModuleCache.create 2014-10-21 10:59:29 -07:00
Kevin Sawicki
1ddb956a94 Cache versions that do not match the range 2014-10-16 16:32:52 -07:00
Kevin Sawicki
305b9bc030 Add missing require 2014-10-16 16:13:23 -07:00
Kevin Sawicki
6ed3ef3f60 Only require coffee file when available
Closes #3864
2014-10-16 15:41:23 -07:00
Kevin Sawicki
f07f096f56 Use Range class that memoizes 2014-10-15 14:47:24 -07:00
Kevin Sawicki
e02af51a04 🐎 Extend range to memoize matched versions 2014-10-15 13:09:47 -07:00
Kevin Sawicki
d2c7a2caca Return early when cache to add is missing 2014-10-15 13:09:47 -07:00
Kevin Sawicki
88f0183352 Remove unneeded quotes 2014-10-15 13:09:47 -07:00
Kevin Sawicki
5052aaca95 Don't leave empty paths with a trailing slash 2014-10-15 13:09:46 -07:00
Kevin Sawicki
a0ae526017 Check candidates after ranges
This way builtins are checked for correctly when the
range isn’t found
2014-10-15 13:09:46 -07:00
Kevin Sawicki
42040f8a9d Return early when no candidates exist 2014-10-15 13:09:46 -07:00
Kevin Sawicki
9d1db0f3de Remove unneeded trailing slash check
Package names don’t have these anyway and file paths
won’t be ending with them.
2014-10-15 13:09:46 -07:00
Kevin Sawicki
f0b922f643 Use String::startsWith 2014-10-15 13:09:46 -07:00
Kevin Sawicki
bb92b8697d Add isCorePath helper 2014-10-15 13:09:46 -07:00
Kevin Sawicki
4c17c9eae6 fs-plust -> fs-plus 2014-10-15 13:09:46 -07:00
Kevin Sawicki
dfd7bcae7f Use process.resourcesPath to find Atom shell root 2014-10-15 13:09:46 -07:00
Kevin Sawicki
f4ddc05b9c Remove call to removed function 2014-10-15 13:09:45 -07:00
Kevin Sawicki
948f96dd6f Only load fs-plus when creating a cache 2014-10-15 13:09:45 -07:00
Kevin Sawicki
db627f5cde 🐎 Join paths manually
path.join calls path.normalize and with the number of paths
being pushed through the cache it is faster to require them
manually since they are already normalized
2014-10-15 13:09:45 -07:00
Kevin Sawicki
a6866656b7 Inline isAbsolute method
This allows fs-plus to be required through the cache
2014-10-15 13:09:45 -07:00
Kevin Sawicki
40c5289e2b Defer requires until the cache is populated 2014-10-15 13:09:45 -07:00
Kevin Sawicki
7dffc58c5b Use Module's filename instead of id 2014-10-15 13:09:45 -07:00
Kevin Sawicki
67d430d100 Add crash-reporter to cache 2014-10-15 13:09:45 -07:00
Kevin Sawicki
b9d89cbf5d Inline valid extensions to check for 2014-10-15 13:09:45 -07:00
Kevin Sawicki
06ac206707 Add clipboard to cache 2014-10-15 13:09:44 -07:00
Kevin Sawicki
6e1bdbbed7 Verify that file path is absolute or relative 2014-10-15 13:09:44 -07:00
Kevin Sawicki
3e3de50eb3 💄 2014-10-15 13:09:44 -07:00
Kevin Sawicki
d7a8dfb209 Add Atom Shell builtins to cache 2014-10-15 13:09:44 -07:00
Kevin Sawicki
b0aea54544 Check cache before atom require short-circuit 2014-10-15 13:09:44 -07:00
Kevin Sawicki
41598af2b2 Add pre-resolved path to require('atom') 2014-10-15 13:09:44 -07:00
Kevin Sawicki
f495db41e7 getCachedModulePath -> resolveModulePath 2014-10-15 13:09:44 -07:00
Kevin Sawicki
76187f176c Add core cache of pre-resolved paths
This reduces the number of calls to Module._findPath for
relative paths since they can be resolved without stating
2014-10-15 13:09:44 -07:00
Kevin Sawicki
d7cb1550bf Remove semicolon 2014-10-15 13:09:44 -07:00
Kevin Sawicki
086be13ac4 Add Module._findPath debug timing and count 2014-10-15 13:09:44 -07:00
Kevin Sawicki
bdc0341eb3 undefined -> return 2014-10-15 13:09:43 -07:00
Kevin Sawicki
171411823f 🐎 Resolve uncached core dependencies
Trust modules under the resource path to be there without stat-ing and
verifying.
2014-10-15 13:09:43 -07:00