Socket
Socket
Sign inDemoInstall

traceur

Package Overview
Dependencies
Maintainers
2
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

traceur - npm Package Compare versions

Comparing version 0.0.66 to 0.0.67

6

package.json
{
"name": "traceur",
"version": "0.0.66",
"version": "0.0.67",
"description": "ES6 to ES5 compiler",

@@ -44,3 +44,3 @@ "keywords": [

"glob": "4.x",
"regexpu": "0.2.1",
"regexpu": "0.3.0",
"rsvp": "^3.0.13",

@@ -58,3 +58,3 @@ "semver": "2.x"

"semver": "2.x",
"traceur": "0.0.65",
"traceur": "0.0.66",
"promises-aplus-tests": "2.x",

@@ -61,0 +61,0 @@ "compat-table": "git+https://github.com/kangax/compat-table.git#gh-pages",

@@ -42,3 +42,3 @@ // Copyright 2013 Traceur Authors.

// if you want to run Traceur-compiled scripts when the compiler isn't present.
var RUNTIME_PATH = path.join(__dirname, '../../bin/traceur-runtime.js');
var RUNTIME_PATH = path.join(__dirname, '../../bin/traceur-runtime.js').replace(/\\/g, '/');

@@ -45,0 +45,0 @@ // extend traceur module

@@ -111,3 +111,10 @@ // Copyright 2013 Traceur Authors.

commandLine.sourceMaps = false;
commandLine.parse(process.argv);
// commanderjs sets self[name]=defaultValue if the argument is null.
// To support --source-maps a legacy boolean we need to transfer the
// the self value here.
commandOptions.sourceMaps = commandLine.sourceMaps;
// Set the global options for back compat, but try to use options by argument.

@@ -114,0 +121,0 @@ traceurAPI.options.setFromObject(commandOptions);

@@ -38,26 +38,12 @@ // Copyright 2014 Traceur Authors.

resolveModuleName: function(filename) {
if (!filename)
return;
var moduleName = filename.replace(/\.js$/, '');
return path.relative(this.sourceRoot, moduleName).replace(/\\/g,'/');
},
sourceName: function(filename) {
return path.relative(this.sourceRoot, filename);
},
writeTreeToFile: function(tree, filename) {
var compiledCode = this.write(tree);
var sourcemap = this.getSourceMap();
if (sourcemap) {
// Assume that the .map and .js will be in the same subdirectory,
// Use the rule from Source Map Revision 3:
// If the generated code is associated with a script element and the
// script element has a “src” attribute, the “src” attribute of the script
// element will be the source origin.
var sourceMapFilePath = path.basename(filename.replace(/\.js$/, '.map'));
compiledCode += '\n//# sourceMappingURL=' + sourceMapFilePath + '\n';
writeFile(sourceMapFilePath, sourcemap);
filename = this.normalize(filename);
var compiledCode = this.write(tree, filename);
if (this.options_.sourceMaps === 'file') {
var sourcemap = this.getSourceMap();
if (sourcemap) {
writeFile(this.sourceMappingURL(filename), sourcemap);
}
}
writeFile(filename, compiledCode);

@@ -67,2 +53,4 @@ },

compileSingleFile: function(inputFilePath, outputFilePath, errback) {
inputFilePath = this.normalize(inputFilePath);
outputFilePath = this.normalize(outputFilePath);
fs.readFile(inputFilePath, function(err, contents) {

@@ -77,2 +65,10 @@ if (err) {

}.bind(this));
},
sourceMappingURL: function(filename) {
if (this.options_.sourceMaps === 'inline') {
var base64sm = new Buffer(this.getSourceMap()).toString('base64');
return 'data:application/json;base64,' + base64sm;
}
return Compiler.prototype.sourceMappingURL.call(this, filename);
}

@@ -79,0 +75,0 @@ };

@@ -40,3 +40,3 @@ // Copyright 2012 Traceur Authors.

var compiler = new NodeCompiler(options, cwd + '/');
var compiler = new NodeCompiler(options);

@@ -43,0 +43,0 @@ mkdirRecursive(outputDir);

@@ -32,3 +32,3 @@ // Copyright 2013 Traceur Authors.

options.moduleName = filename;
return traceurAPI.compile(contents, options);
return traceurAPI.compile(contents, options, filename);
}

@@ -35,0 +35,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc