jasmine-core 2.6.3 → 2.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: jasmine-core
3
- Version: 2.6.2
3
+ Version: 2.6.3
4
4
  Summary: Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any JavaScript framework. Thus it's suited for websites, Node.js (http://nodejs.org) projects, or anywhere that JavaScript can run.
5
5
  Home-page: http://jasmine.github.io
6
6
  Author: Pivotal Labs
@@ -1600,7 +1600,9 @@ getJasmineRequireObj().CallTracker = function(j$) {
1600
1600
  };
1601
1601
 
1602
1602
  getJasmineRequireObj().clearStack = function(j$) {
1603
- function messageChannelImpl(global) {
1603
+ var maxInlineCallCount = 10;
1604
+
1605
+ function messageChannelImpl(global, setTimeout) {
1604
1606
  var channel = new global.MessageChannel(),
1605
1607
  head = {},
1606
1608
  tail = head;
@@ -1623,25 +1625,44 @@ getJasmineRequireObj().clearStack = function(j$) {
1623
1625
  }
1624
1626
  };
1625
1627
 
1628
+ var currentCallCount = 0;
1626
1629
  return function clearStack(fn) {
1627
- tail = tail.next = { task: fn };
1628
- channel.port2.postMessage(0);
1630
+ currentCallCount++;
1631
+
1632
+ if (currentCallCount < maxInlineCallCount) {
1633
+ tail = tail.next = { task: fn };
1634
+ channel.port2.postMessage(0);
1635
+ } else {
1636
+ currentCallCount = 0;
1637
+ setTimeout(fn);
1638
+ }
1629
1639
  };
1630
1640
  }
1631
1641
 
1632
1642
  function getClearStack(global) {
1643
+ var currentCallCount = 0;
1644
+ var realSetTimeout = global.setTimeout;
1645
+ var setTimeoutImpl = function clearStack(fn) {
1646
+ Function.prototype.apply.apply(realSetTimeout, [global, [fn, 0]]);
1647
+ };
1648
+
1633
1649
  if (j$.isFunction_(global.setImmediate)) {
1634
1650
  var realSetImmediate = global.setImmediate;
1635
1651
  return function(fn) {
1636
- realSetImmediate(fn);
1652
+ currentCallCount++;
1653
+
1654
+ if (currentCallCount < maxInlineCallCount) {
1655
+ realSetImmediate(fn);
1656
+ } else {
1657
+ currentCallCount = 0;
1658
+
1659
+ setTimeoutImpl(fn);
1660
+ }
1637
1661
  };
1638
1662
  } else if (!j$.util.isUndefined(global.MessageChannel)) {
1639
- return messageChannelImpl(global);
1663
+ return messageChannelImpl(global, setTimeoutImpl);
1640
1664
  } else {
1641
- var realSetTimeout = global.setTimeout;
1642
- return function clearStack(fn) {
1643
- Function.prototype.apply.apply(realSetTimeout, [global, [fn, 0]]);
1644
- };
1665
+ return setTimeoutImpl;
1645
1666
  }
1646
1667
  }
1647
1668
 
@@ -4976,5 +4997,5 @@ getJasmineRequireObj().TreeProcessor = function() {
4976
4997
  };
4977
4998
 
4978
4999
  getJasmineRequireObj().version = function() {
4979
- return '2.6.3';
5000
+ return '2.6.4';
4980
5001
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jasmine-core",
3
3
  "license": "MIT",
4
- "version": "2.6.3",
4
+ "version": "2.6.4",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/jasmine/jasmine.git"