Assign Package.prototype.mainModulePath eagerly for preloaded packages

Many packages currently use this instance variable instead of calling
`Package.prototype.getMainModulePath`. With this commit we will eagerly
compute it for preloaded packages too and therefore prevent third party
packages that rely on this implementation detail from breaking.
This commit is contained in:
Antonio Scandurra
2017-04-03 14:11:23 +02:00
parent 6a8d0915db
commit 6ecb9086ee

View File

@@ -102,6 +102,10 @@ class Package
@path = path.join(@packageManager.resourcePath, @path)
@loadStylesheets()
# Unfortunately some packages are accessing `@mainModulePath`, so we need
# to compute that variable eagerly also for preloaded packages.
@getMainModulePath()
load: ->
@measure 'loadTime', =>
try