babel-source 5.6.15 → 5.6.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -101,7 +101,7 @@
101
101
  delete descriptor.decorators;
102
102
  descriptor.enumerable = true;
103
103
  descriptor.configurable = true;
104
- descriptor.writable = true;
104
+ if ("value" in descriptor || descriptor.initializer) descriptor.writable = true;
105
105
 
106
106
  if (decorators) {
107
107
  for (var f = 0; f < decorators.length; f++) {
@@ -3433,9 +3433,24 @@ module.exports = require('./modules/$').core;
3433
3433
  return value instanceof AwaitArgument
3434
3434
  ? Promise.resolve(value.arg).then(invokeNext, invokeThrow)
3435
3435
  : Promise.resolve(value).then(function(unwrapped) {
3436
+ // When a yielded Promise is resolved, its final value becomes
3437
+ // the .value of the Promise<{value,done}> result for the
3438
+ // current iteration. If the Promise is rejected, however, the
3439
+ // result for this iteration will be rejected with the same
3440
+ // reason. Note that rejections of yielded Promises are not
3441
+ // thrown back into the generator function, as is the case
3442
+ // when an awaited Promise is rejected. This difference in
3443
+ // behavior between yield and await is important, because it
3444
+ // allows the consumer to decide what to do with the yielded
3445
+ // rejection (swallow it and continue, manually .throw it back
3446
+ // into the generator, abandon iteration, whatever). With
3447
+ // await, by contrast, there is no opportunity to examine the
3448
+ // rejection reason outside the generator function, so the
3449
+ // only option is to throw it from the await expression, and
3450
+ // let the generator function handle the exception.
3436
3451
  result.value = unwrapped;
3437
3452
  return result;
3438
- }, invokeThrow);
3453
+ });
3439
3454
  }
3440
3455
 
3441
3456
  if (typeof process === "object" && process.domain) {
@@ -3468,9 +3483,8 @@ module.exports = require('./modules/$').core;
3468
3483
  });
3469
3484
 
3470
3485
  // Avoid propagating enqueueResult failures to Promises returned by
3471
- // later invocations of the iterator, and call generator.return() to
3472
- // allow the generator a chance to clean up.
3473
- previousPromise = enqueueResult["catch"](invokeReturn);
3486
+ // later invocations of the iterator.
3487
+ previousPromise = enqueueResult["catch"](function(ignored){});
3474
3488
 
3475
3489
  return enqueueResult;
3476
3490
  }
@@ -3506,6 +3520,10 @@ module.exports = require('./modules/$').core;
3506
3520
  }
3507
3521
 
3508
3522
  if (state === GenStateCompleted) {
3523
+ if (method === "throw") {
3524
+ throw arg;
3525
+ }
3526
+
3509
3527
  // Be forgiving, per 25.3.3.3.3 of the spec:
3510
3528
  // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
3511
3529
  return doneResult();
@@ -3579,7 +3597,7 @@ module.exports = require('./modules/$').core;
3579
3597
  if (state === GenStateSuspendedYield) {
3580
3598
  context.sent = arg;
3581
3599
  } else {
3582
- delete context.sent;
3600
+ context.sent = undefined;
3583
3601
  }
3584
3602
 
3585
3603
  } else if (method === "throw") {
@@ -3675,7 +3693,7 @@ module.exports = require('./modules/$').core;
3675
3693
  // locations where there is no enclosing try statement.
3676
3694
  this.tryEntries = [{ tryLoc: "root" }];
3677
3695
  tryLocsList.forEach(pushTryEntry, this);
3678
- this.reset();
3696
+ this.reset(true);
3679
3697
  }
3680
3698
 
3681
3699
  runtime.keys = function(object) {
@@ -3748,7 +3766,7 @@ module.exports = require('./modules/$').core;
3748
3766
  Context.prototype = {
3749
3767
  constructor: Context,
3750
3768
 
3751
- reset: function() {
3769
+ reset: function(skipTempReset) {
3752
3770
  this.prev = 0;
3753
3771
  this.next = 0;
3754
3772
  this.sent = undefined;
@@ -3757,12 +3775,15 @@ module.exports = require('./modules/$').core;
3757
3775
 
3758
3776
  this.tryEntries.forEach(resetTryEntry);
3759
3777
 
3760
- // Pre-initialize at least 20 temporary variables to enable hidden
3761
- // class optimizations for simple generators.
3762
- for (var tempIndex = 0, tempName;
3763
- hasOwn.call(this, tempName = "t" + tempIndex) || tempIndex < 20;
3764
- ++tempIndex) {
3765
- this[tempName] = null;
3778
+ if (!skipTempReset) {
3779
+ for (var name in this) {
3780
+ // Not sure about the optimal order of these conditions:
3781
+ if (name.charAt(0) === "t" &&
3782
+ hasOwn.call(this, name) &&
3783
+ !isNaN(+name.slice(1))) {
3784
+ this[name] = undefined;
3785
+ }
3786
+ }
3766
3787
  }
3767
3788
  },
3768
3789
 
data/lib/babel/source.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Babel
2
2
  module Source
3
- VERSION = "5.6.15"
4
- DATE = Time.at(1435360044)
3
+ VERSION = "5.6.16"
4
+ DATE = Time.at(1436454786)
5
5
  PATH = File.expand_path("../..", __FILE__)
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: babel-source
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.15
4
+ version: 5.6.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian McKenzie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-26 00:00:00.000000000 Z
11
+ date: 2015-07-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: sebmck@gmail.com