Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-traceur

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-traceur - npm Package Compare versions

Comparing version 0.13.0 to 0.14.0

45

index.js
'use strict';
var gutil = require('gulp-util');
var through = require('through2');
var traceur = require('traceur');
var applySourceMap = require('vinyl-sourcemaps-apply');
var objectAssign = require('object-assign');
var traceur = require('traceur');
module.exports = function (options) {
options = options || {};
module.exports = function (opts) {
opts = opts || {};
return through.obj(function (file, enc, cb) {
if (file.isNull()) {
this.push(file);
cb();
cb(null, file);
return;

@@ -19,12 +18,8 @@ }

if (file.isStream()) {
this.emit('error', new gutil.PluginError('gulp-traceur', 'Streaming not supported'));
cb();
cb(new gutil.PluginError('gulp-traceur', 'Streaming not supported'));
return;
}
var ret;
var fileOptions = objectAssign({modules: 'commonjs'}, opts);
var fileOptions = objectAssign({}, options);
fileOptions.filename = file.relative;
if (file.sourceMap) {

@@ -35,23 +30,19 @@ fileOptions.sourceMaps = true;

try {
ret = traceur.compile(file.contents.toString(), fileOptions);
var compiler = new traceur.NodeCompiler(fileOptions);
var ret = compiler.compile(file.contents.toString(), file.relative, file.relative, file.base);
var generatedSourceMap = compiler.getSourceMap();
if (ret.js) {
file.contents = new Buffer(ret.js);
if (ret) {
file.contents = new Buffer(ret);
}
if (ret.generatedSourceMap && file.sourceMap) {
applySourceMap(file, ret.generatedSourceMap);
if (generatedSourceMap && file.sourceMap) {
applySourceMap(file, generatedSourceMap);
}
if (ret.errors.length > 0) {
this.emit('error', new gutil.PluginError('gulp-traceur', '\n' + ret.errors.join('\n'), {
fileName: file.path,
showStack: false
}));
} else {
this.push(file);
}
} catch (err) {
this.emit('error', new gutil.PluginError('gulp-traceur', err, {
fileName: file.path
this.push(file);
} catch (errs) {
this.emit('error', new gutil.PluginError('gulp-traceur', errs.join('\n'), {
fileName: file.path,
showStack: false
}));

@@ -58,0 +49,0 @@ }

{
"name": "gulp-traceur",
"version": "0.13.0",
"version": "0.14.0",
"description": "Traceur is a JavaScript.next to JavaScript-of-today compiler",

@@ -43,8 +43,9 @@ "license": "MIT",

"through2": "^0.6.1",
"traceur": "0.0.58",
"traceur": "0.0.74",
"vinyl-sourcemaps-apply": "^0.1.1"
},
"devDependencies": {
"gulp-sourcemaps": "^1.2.8",
"mocha": "*"
}
}

2

readme.md

@@ -23,3 +23,3 @@ # [gulp](http://gulpjs.com)-traceur [![Build Status](https://travis-ci.org/sindresorhus/gulp-traceur.svg?branch=master)](https://travis-ci.org/sindresorhus/gulp-traceur)

return gulp.src('src/app.js')
.pipe(traceur({sourceMap: true}))
.pipe(traceur())
.pipe(gulp.dest('dist'));

@@ -26,0 +26,0 @@ });

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