More fixes for @kevinsawicki

This commit is contained in:
Michael Bolin 2015-01-29 12:15:10 -08:00
parent acd1d31480
commit 32b3c4076f
2 changed files with 7 additions and 8 deletions

View File

@ -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'
]

View File

@ -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 =