Skip to content

Commit

Permalink
allow for fewer fiber yields
Browse files Browse the repository at this point in the history
  • Loading branch information
znewsham committed Oct 5, 2023
1 parent 6cf1eab commit 6982b2b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion npm-packages/meteor-promise/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "meteor-promise",
"author": "Ben Newman <[email protected]>",
"version": "0.9.1-1",
"version": "0.9.1-2",
"description": "ES6 Promise polyfill with Fiber support",
"keywords": [
"meteor",
Expand Down
4 changes: 4 additions & 0 deletions npm-packages/meteor-promise/promise_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var fiberPool = require("./fiber_pool.js").makePool();

exports.makeCompatible = function (Promise, Fiber) {
var es6PromiseThen = Promise.prototype.then;
Promise.prototype.es6PromiseThen = es6PromiseThen;

if (typeof Fiber === "function") {
Promise.Fiber = Fiber;
Expand All @@ -16,6 +17,9 @@ exports.makeCompatible = function (Promise, Fiber) {
var Promise = this.constructor;
var Fiber = Promise.Fiber;

if (Promise.noYieldOnFiberlessThen && Fiber && !Fiber.current) {
return es6PromiseThen.call(this, onResolved, onRejected);
}
if (typeof Fiber === "function" &&
! this._meteorPromiseAlreadyWrapped) {
onResolved = wrapCallback(onResolved, Promise);
Expand Down
4 changes: 2 additions & 2 deletions packages/promise/package.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Package.describe({
name: "promise",
version: "0.12.1-1",
version: "0.12.1-2",
summary: "ECMAScript 2015 Promise polyfill with Fiber support",
git: "https://github.com/meteor/promise",
documentation: "README.md"
});

Npm.depends({
// TODO: can we just drop this now?
"meteor-promise": "0.9.1-1",
"meteor-promise": "0.9.1-2",
"promise": "8.1.0"
});

Expand Down

0 comments on commit 6982b2b

Please sign in to comment.