mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 23:48:05 +03:00
More fixes for @kevinsawicki
This commit is contained in:
parent
acd1d31480
commit
32b3c4076f
@ -1,14 +1,14 @@
|
||||
{create6to5VersionAndOptionsDigest} = require '../src/esnext'
|
||||
crypto = require 'crypto'
|
||||
|
||||
describe "esnext", ->
|
||||
describe "::create6to5VersionAndOptionsDigest", ->
|
||||
|
||||
it "::create6to5VersionAndOptionsDigest", ->
|
||||
it "returns a digest for the library version and specified options", ->
|
||||
defaultOptions =
|
||||
'blacklist': [
|
||||
'useStrict'
|
||||
]
|
||||
'experimental': true,
|
||||
'experimental': true
|
||||
'optional': [
|
||||
'asyncToGenerator'
|
||||
]
|
||||
|
@ -34,7 +34,7 @@ defaultOptions =
|
||||
|
||||
# Includes support for es7 features listed at:
|
||||
# http://6to5.org/docs/usage/transformers/#es7-experimental-.
|
||||
experimental: true,
|
||||
experimental: true
|
||||
|
||||
optional: [
|
||||
# Target a version of the regenerator runtime that
|
||||
@ -108,8 +108,7 @@ getCachedJavaScript = (cachePath) ->
|
||||
|
||||
# Returns the 6to5 options that should be used to transpile filePath.
|
||||
createOptions = (filePath) ->
|
||||
options =
|
||||
'filename': filePath
|
||||
options = filename: filePath
|
||||
for key, value of defaultOptions
|
||||
options[key] = value
|
||||
options
|
||||
@ -119,7 +118,7 @@ createOptions = (filePath) ->
|
||||
# either generated on the fly or pulled from cache.
|
||||
loadFile = (module, filePath) ->
|
||||
sourceCode = fs.readFileSync(filePath, 'utf8')
|
||||
if not (sourceCode.startsWith('"use 6to5"') or sourceCode.startsWith("'use 6to5'"))
|
||||
unless sourceCode.startsWith('"use 6to5"') or sourceCode.startsWith("'use 6to5'")
|
||||
module._compile(sourceCode, filePath)
|
||||
return
|
||||
|
||||
@ -143,7 +142,7 @@ loadFile = (module, filePath) ->
|
||||
|
||||
module._compile(js, filePath)
|
||||
|
||||
register = (appVersion) ->
|
||||
register = () ->
|
||||
require.extensions['.js'] = loadFile
|
||||
|
||||
module.exports =
|
||||
|
Loading…
Reference in New Issue
Block a user