Comparing version 0.0.28 to 0.0.29
@@ -308,3 +308,4 @@ (function(global) { | ||
var ST_CLOSED = 3; | ||
var END_STATE = -3; | ||
var END_STATE = -2; | ||
var RETHROW_STATE = -3; | ||
function addIterator(object) { | ||
@@ -315,2 +316,5 @@ return defineProperty(object, Symbol.iterator, nonEnum(function() { | ||
} | ||
function getInternalError(state) { | ||
return new Error('Traceur compiler bug: invalid state in state machine: ' + state); | ||
} | ||
function GeneratorContext() { | ||
@@ -321,3 +325,3 @@ this.state = 0; | ||
this.finallyFallThrough = undefined; | ||
this.sent = undefined; | ||
this.sent_ = undefined; | ||
this.returnValue = undefined; | ||
@@ -337,3 +341,3 @@ this.tryStack_ = []; | ||
if (finallyFallThrough === null) | ||
finallyFallThrough = -3; | ||
finallyFallThrough = RETHROW_STATE; | ||
this.tryStack_.push({ | ||
@@ -350,2 +354,28 @@ finally: finallyState, | ||
this.tryStack_.pop(); | ||
}, | ||
get sent() { | ||
this.maybeThrow(); | ||
return this.sent_; | ||
}, | ||
set sent(v) { | ||
this.sent_ = v; | ||
}, | ||
get sentIgnoreThrow() { | ||
return this.sent_; | ||
}, | ||
maybeThrow: function() { | ||
if (this.action === 'throw') { | ||
this.action = 'next'; | ||
throw this.sent_; | ||
} | ||
}, | ||
end: function() { | ||
switch (this.state) { | ||
case END_STATE: | ||
return this; | ||
case RETHROW_STATE: | ||
throw this.storedException; | ||
default: | ||
throw getInternalError(this.state); | ||
} | ||
} | ||
@@ -401,2 +431,12 @@ }; | ||
AsyncFunctionContext.prototype = Object.create(GeneratorContext.prototype); | ||
AsyncFunctionContext.prototype.end = function() { | ||
switch (this.state) { | ||
case END_STATE: | ||
return; | ||
case RETHROW_STATE: | ||
this.reject(this.storedException); | ||
default: | ||
this.reject(getInternalError(this.state)); | ||
} | ||
}; | ||
function asyncWrap(innerFunction, self) { | ||
@@ -541,3 +581,3 @@ var moveNext = getMoveNext(innerFunction, self); | ||
var path = parts[ComponentIndex.PATH] || ''; | ||
path = removeDotSegments(path.replace(/\/\//.g, '/')); | ||
path = removeDotSegments(path); | ||
parts[ComponentIndex.PATH] = path; | ||
@@ -735,5 +775,5 @@ return buildFromEncodedParts(parts[ComponentIndex.SCHEME], parts[ComponentIndex.USER_INFO], parts[ComponentIndex.DOMAIN], parts[ComponentIndex.PORT], parts[ComponentIndex.PATH], parts[ComponentIndex.QUERY_DATA], parts[ComponentIndex.FRAGMENT]); | ||
})(typeof global !== 'undefined' ? global : this); | ||
System.register("traceur-runtime@0.0.28/src/runtime/polyfills/utils", [], function() { | ||
System.register("traceur-runtime@0.0.29/src/runtime/polyfills/utils", [], function() { | ||
"use strict"; | ||
var __moduleName = "traceur-runtime@0.0.28/src/runtime/polyfills/utils"; | ||
var __moduleName = "traceur-runtime@0.0.29/src/runtime/polyfills/utils"; | ||
var toObject = $traceurRuntime.toObject; | ||
@@ -752,7 +792,7 @@ function toUint32(x) { | ||
}); | ||
System.register("traceur-runtime@0.0.28/src/runtime/polyfills/ArrayIterator", [], function() { | ||
System.register("traceur-runtime@0.0.29/src/runtime/polyfills/ArrayIterator", [], function() { | ||
"use strict"; | ||
var $__4; | ||
var __moduleName = "traceur-runtime@0.0.28/src/runtime/polyfills/ArrayIterator"; | ||
var $__5 = System.get("traceur-runtime@0.0.28/src/runtime/polyfills/utils"), | ||
var __moduleName = "traceur-runtime@0.0.29/src/runtime/polyfills/ArrayIterator"; | ||
var $__5 = System.get("traceur-runtime@0.0.29/src/runtime/polyfills/utils"), | ||
toObject = $__5.toObject, | ||
@@ -831,5 +871,5 @@ toUint32 = $__5.toUint32; | ||
}); | ||
System.register("traceur-runtime@0.0.28/node_modules/rsvp/lib/rsvp/asap", [], function() { | ||
System.register("traceur-runtime@0.0.29/node_modules/rsvp/lib/rsvp/asap", [], function() { | ||
"use strict"; | ||
var __moduleName = "traceur-runtime@0.0.28/node_modules/rsvp/lib/rsvp/asap"; | ||
var __moduleName = "traceur-runtime@0.0.29/node_modules/rsvp/lib/rsvp/asap"; | ||
var $__default = function asap(callback, arg) { | ||
@@ -884,6 +924,6 @@ var length = queue.push([callback, arg]); | ||
}); | ||
System.register("traceur-runtime@0.0.28/src/runtime/polyfills/Promise", [], function() { | ||
System.register("traceur-runtime@0.0.29/src/runtime/polyfills/Promise", [], function() { | ||
"use strict"; | ||
var __moduleName = "traceur-runtime@0.0.28/src/runtime/polyfills/Promise"; | ||
var async = System.get("traceur-runtime@0.0.28/node_modules/rsvp/lib/rsvp/asap").default; | ||
var __moduleName = "traceur-runtime@0.0.29/src/runtime/polyfills/Promise"; | ||
var async = System.get("traceur-runtime@0.0.29/node_modules/rsvp/lib/rsvp/asap").default; | ||
function isPromise(x) { | ||
@@ -1069,5 +1109,5 @@ return x && typeof x === 'object' && x.status_ !== undefined; | ||
}); | ||
System.register("traceur-runtime@0.0.28/src/runtime/polyfills/String", [], function() { | ||
System.register("traceur-runtime@0.0.29/src/runtime/polyfills/String", [], function() { | ||
"use strict"; | ||
var __moduleName = "traceur-runtime@0.0.28/src/runtime/polyfills/String"; | ||
var __moduleName = "traceur-runtime@0.0.29/src/runtime/polyfills/String"; | ||
var $toString = Object.prototype.toString; | ||
@@ -1241,7 +1281,7 @@ var $indexOf = String.prototype.indexOf; | ||
}); | ||
System.register("traceur-runtime@0.0.28/src/runtime/polyfills/polyfills", [], function() { | ||
System.register("traceur-runtime@0.0.29/src/runtime/polyfills/polyfills", [], function() { | ||
"use strict"; | ||
var __moduleName = "traceur-runtime@0.0.28/src/runtime/polyfills/polyfills"; | ||
var Promise = System.get("traceur-runtime@0.0.28/src/runtime/polyfills/Promise").Promise; | ||
var $__9 = System.get("traceur-runtime@0.0.28/src/runtime/polyfills/String"), | ||
var __moduleName = "traceur-runtime@0.0.29/src/runtime/polyfills/polyfills"; | ||
var Promise = System.get("traceur-runtime@0.0.29/src/runtime/polyfills/Promise").Promise; | ||
var $__9 = System.get("traceur-runtime@0.0.29/src/runtime/polyfills/String"), | ||
codePointAt = $__9.codePointAt, | ||
@@ -1254,3 +1294,3 @@ contains = $__9.contains, | ||
startsWith = $__9.startsWith; | ||
var $__9 = System.get("traceur-runtime@0.0.28/src/runtime/polyfills/ArrayIterator"), | ||
var $__9 = System.get("traceur-runtime@0.0.29/src/runtime/polyfills/ArrayIterator"), | ||
entries = $__9.entries, | ||
@@ -1308,8 +1348,8 @@ keys = $__9.keys, | ||
}); | ||
System.register("traceur-runtime@0.0.28/src/runtime/polyfill-import", [], function() { | ||
System.register("traceur-runtime@0.0.29/src/runtime/polyfill-import", [], function() { | ||
"use strict"; | ||
var __moduleName = "traceur-runtime@0.0.28/src/runtime/polyfill-import"; | ||
var $__11 = System.get("traceur-runtime@0.0.28/src/runtime/polyfills/polyfills"); | ||
var __moduleName = "traceur-runtime@0.0.29/src/runtime/polyfill-import"; | ||
var $__11 = System.get("traceur-runtime@0.0.29/src/runtime/polyfills/polyfills"); | ||
return {}; | ||
}); | ||
System.get("traceur-runtime@0.0.28/src/runtime/polyfill-import" + ''); | ||
System.get("traceur-runtime@0.0.29/src/runtime/polyfill-import" + ''); |
{ | ||
"name": "traceur", | ||
"version": "0.0.28", | ||
"version": "0.0.29", | ||
"description": "Experimental ES6 to ES5 compiler", | ||
@@ -48,5 +48,5 @@ "keywords": [ | ||
"semver": "2.2.1", | ||
"traceur": "0.0.27" | ||
"traceur": "0.0.28" | ||
}, | ||
"subdomain": "traceur" | ||
} |
[![Build Status](https://travis-ci.org/google/traceur-compiler.png)](https://travis-ci.org/google/traceur-compiler) | ||
<img src="logo/tc.png" alt="Traceur logo" width="200px"> | ||
<img src="https://raw.github.com/google/traceur-compiler/master/logo/tc.png" alt="Traceur logo" width="200px"> | ||
## What is Traceur? | ||
@@ -5,0 +5,0 @@ |
@@ -24,2 +24,4 @@ // Copyright 2013 Traceur Authors. | ||
var traceur = require('./traceur.js'); | ||
var AttachModuleNameTransformer = | ||
traceur.codegeneration.module.AttachModuleNameTransformer; | ||
var ErrorReporter = traceur.util.TestErrorReporter; | ||
@@ -62,3 +64,4 @@ var FromOptionsTransformer = traceur.codegeneration.FromOptionsTransformer; | ||
filename: '<unknown file>', | ||
sourceMap: false | ||
sourceMap: false, | ||
cwd: process.cwd() | ||
}, options || {}); | ||
@@ -73,3 +76,7 @@ | ||
var tree = parser.parseModule(); | ||
var transformer = new FromOptionsTransformer(errorReporter); | ||
var moduleName = options.filename.replace(/\.js$/, ''); | ||
moduleName = path.relative(options.cwd, moduleName).replace(/\\/g,'/'); | ||
var transformer = new AttachModuleNameTransformer(moduleName); | ||
tree = transformer.transformAny(tree); | ||
transformer = new FromOptionsTransformer(errorReporter); | ||
var transformedTree = transformer.transform(tree); | ||
@@ -76,0 +83,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
946718
24301