babel-source 5.8.14 → 5.8.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +8 -8
  2. data/lib/babel.js +32150 -32026
  3. data/lib/babel/polyfill.js +38 -6
  4. data/lib/babel/source.rb +2 -2
  5. metadata +2 -2
@@ -4,32 +4,64 @@
4
4
  var process = module.exports = {};
5
5
  var queue = [];
6
6
  var draining = false;
7
+ var currentQueue;
8
+ var queueIndex = -1;
9
+
10
+ function cleanUpNextTick() {
11
+ draining = false;
12
+ if (currentQueue.length) {
13
+ queue = currentQueue.concat(queue);
14
+ } else {
15
+ queueIndex = -1;
16
+ }
17
+ if (queue.length) {
18
+ drainQueue();
19
+ }
20
+ }
7
21
 
8
22
  function drainQueue() {
9
23
  if (draining) {
10
24
  return;
11
25
  }
26
+ var timeout = setTimeout(cleanUpNextTick);
12
27
  draining = true;
13
- var currentQueue;
28
+
14
29
  var len = queue.length;
15
30
  while(len) {
16
31
  currentQueue = queue;
17
32
  queue = [];
18
- var i = -1;
19
- while (++i < len) {
20
- currentQueue[i]();
33
+ while (++queueIndex < len) {
34
+ currentQueue[queueIndex].run();
21
35
  }
36
+ queueIndex = -1;
22
37
  len = queue.length;
23
38
  }
39
+ currentQueue = null;
24
40
  draining = false;
41
+ clearTimeout(timeout);
25
42
  }
43
+
26
44
  process.nextTick = function (fun) {
27
- queue.push(fun);
28
- if (!draining) {
45
+ var args = new Array(arguments.length - 1);
46
+ if (arguments.length > 1) {
47
+ for (var i = 1; i < arguments.length; i++) {
48
+ args[i - 1] = arguments[i];
49
+ }
50
+ }
51
+ queue.push(new Item(fun, args));
52
+ if (queue.length === 1 && !draining) {
29
53
  setTimeout(drainQueue, 0);
30
54
  }
31
55
  };
32
56
 
57
+ // v8 likes predictible objects
58
+ function Item(fun, array) {
59
+ this.fun = fun;
60
+ this.array = array;
61
+ }
62
+ Item.prototype.run = function () {
63
+ this.fun.apply(null, this.array);
64
+ };
33
65
  process.title = 'browser';
34
66
  process.browser = true;
35
67
  process.env = {};
@@ -1,7 +1,7 @@
1
1
  module Babel
2
2
  module Source
3
- VERSION = "5.8.14"
4
- DATE = Time.at(1438105208)
3
+ VERSION = "5.8.15"
4
+ DATE = Time.at(1438140172)
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.8.14
4
+ version: 5.8.15
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-07-28 00:00:00.000000000 Z
11
+ date: 2015-07-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: sebmck@gmail.com