1////////////////////////////////////////////////////////////////////////// 2// // 3// This is a generated file. You can view the original // 4// source in your browser if your browser supports source maps. // 5// Source maps are supported by all recent versions of Chrome, Safari, // 6// and Firefox, and by Internet Explorer 11. // 7// // 8////////////////////////////////////////////////////////////////////////// 9 10 11Package["core-runtime"].queue("promise",function () {/* Imports */ 12var Meteor = Package.meteor.Meteor; 13var global = Package.meteor.global; 14var meteorEnv = Package.meteor.meteorEnv; 15var meteorInstall = Package.modules.meteorInstall; 16var meteorBabelHelpers = Package.modules.meteorBabelHelpers; 17 18/* Package-scope variables */ 19var Promise; 20 21var require = meteorInstall({"node_modules":{"meteor":{"promise":{
21"modern.js":function module(){ 22 23////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 24// // 25// packages/promise/modern.js // 26// // 27////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 28 // 29// Initialize the package-scoped Promise variable with global.Promise in 30// all environments, even if it's not defined. 31Promise = global.Promise; 32 33////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 34 35},
35"legacy.js":function module(require){ 36 37////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 38// // 39// packages/promise/legacy.js // 40// // 41////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 42 // 43// In legacy environments, load a polyfill if global.Promise was not 44// defined in modern.js. 45if (typeof global.Promise === "function") { 46 Promise = global.Promise; 47} else { 48 Promise = global.Promise = 49 require("promise/lib/es6-extensions"); 50} 51 52////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 53 54},
54"client.js":function module(require){ 55 56////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 57// // 58// packages/promise/client.js // 59// // 60////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 61 // 62require("./extensions.js"); 63 64////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 65 66},
66"extensions.js":function module(){ 67 68////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 69// // 70// packages/promise/extensions.js // 71// // 72////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 73 // 74var proto = Promise.prototype; 75var hasOwn = Object.prototype.hasOwnProperty; 76 77proto.done = function (onFulfilled, onRejected) { 78 var self = this; 79 80 if (arguments.length > 0) { 81 self = this.then.apply(this, arguments); 82 } 83 84 self.then(null, function (err) { 85 Meteor._setImmediate(function () { 86 throw err; 87 }); 88 }); 89}; 90 91if (! hasOwn.call(proto, "finally")) { 92 proto["finally"] = function (onFinally) { 93 var threw = false, result; 94 return this.then(function (value) { 95 result = value; 96 // Most implementations of Promise.prototype.finally call 97 // Promise.resolve(onFinally()) (or this.constructor.resolve or even 98 // this.constructor[Symbol.species].resolve, depending on how spec 99 // compliant they're trying to be), but this implementation simply 100 // relies on the standard Promise behavior of resolving any value 101 // returned from a .then callback function. 102 return onFinally(); 103 }, function (error) { 104 // Make the final .then callback (below) re-throw the error instead 105 // of returning it. 106 threw = true; 107 result = error; 108 return onFinally(); 109 }).then(function () { 110 if (threw) throw result; 111 return result; 112 }); 113 }; 114} 115 116////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 117 118},"node_modules":{"promise":{"lib":{
118"es6-extensions.js":function module(require,exports,module){ 119 120////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 121// // 122// node_modules/meteor/promise/node_modules/promise/lib/es6-extensions.js // 123// // 124////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 125 // 126'use strict'; 127 128//This file contains the ES6 extensions to the core Promises/A+ API 129 130var Promise = require('./core.js'); 131 132module.exports = Promise; 133 134/* Static Functions */ 135 136var TRUE = valuePromise(true); 137var FALSE = valuePromise(false); 138var NULL = valuePromise(null); 139var UNDEFINED = valuePromise(undefined); 140var ZERO = valuePromise(0); 141var EMPTYSTRING = valuePromise(''); 142 143function valuePromise(value) { 144 var p = new Promise(Promise._0); 145 p._V = 1; 146 p._W = value; 147 return p; 148} 149Promise.resolve = function (value) { 150 if (value instanceof Promise) return value; 151 152 if (value === null) return NULL; 153 if (value === undefined) return UNDEFINED; 154 if (value === true) return TRUE; 155 if (value === false) return FALSE; 156 if (value === 0) return ZERO; 157 if (value === '') return EMPTYSTRING; 158 159 if (typeof value === 'object' || typeof value === 'function') { 160 try { 161 var then = value.then; 162 if (typeof then === 'function') { 163 return new Promise(then.bind(value)); 164 } 165 } catch (ex) { 166 return new Promise(function (resolve, reject) { 167 reject(ex); 168 }); 169 } 170 } 171 return valuePromise(value); 172}; 173 174var iterableToArray = function (iterable) { 175 if (typeof Array.from === 'function') { 176 // ES2015+, iterables exist 177 iterableToArray = Array.from; 178 return Array.from(iterable); 179 } 180 181 // ES5, only arrays and array-likes exist 182 iterableToArray = function (x) { return Array.prototype.slice.call(x); }; 183 return Array.prototype.slice.call(iterable); 184} 185 186Promise.all = function (arr) { 187 var args = iterableToArray(arr); 188 189 return new Promise(function (resolve, reject) { 190 if (args.length === 0) return resolve([]); 191 var remaining = args.length; 192 function res(i, val) { 193 if (val && (typeof val === 'object' || typeof val === 'function')) { 194 if (val instanceof Promise && val.then === Promise.prototype.then) { 195 while (val._V === 3) { 196 val = val._W; 197 } 198 if (val._V === 1) return res(i, val._W); 199 if (val._V === 2) reject(val._W); 200 val.then(function (val) { 201 res(i, val); 202 }, reject); 203 return; 204 } else { 205 var then = val.then; 206 if (typeof then === 'function') { 207 var p = new Promise(then.bind(val)); 208 p.then(function (val) { 209 res(i, val); 210 }, reject); 211 return; 212 } 213 } 214 } 215 args[i] = val; 216 if (--remaining === 0) { 217 resolve(args); 218 } 219 } 220 for (var i = 0; i < args.length; i++) { 221 res(i, args[i]); 222 } 223 }); 224}; 225 226Promise.reject = function (value) { 227 return new Promise(function (resolve, reject) { 228 reject(value); 229 }); 230}; 231 232Promise.race = function (values) { 233 return new Promise(function (resolve, reject) { 234 iterableToArray(values).forEach(function(value){ 235 Promise.resolve(value).then(resolve, reject); 236 }); 237 }); 238}; 239 240/* Prototype Methods */ 241 242Promise.prototype['catch'] = function (onRejected) { 243 return this.then(null, onRejected); 244}; 245 246////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 247 248},
248"core.js":function module(require,exports,module){ 249 250////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 251// // 252// node_modules/meteor/promise/node_modules/promise/lib/core.js // 253// // 254////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 255 // 256'use strict'; 257 258var asap = require('asap/raw'); 259 260function noop() {} 261 262// States: 263// 264// 0 - pending 265// 1 - fulfilled with _value 266// 2 - rejected with _value 267// 3 - adopted the state of another promise, _value 268// 269// once the state is no longer pending (0) it is immutable 270 271// All `_` prefixed properties will be reduced to `_{random number}` 272// at build time to obfuscate them and discourage their use. 273// We don't use symbols or Object.defineProperty to fully hide them 274// because the performance isn't good enough. 275 276 277// to avoid using try/catch inside critical functions, we 278// extract them to here. 279var LAST_ERROR = null; 280var IS_ERROR = {}; 281function getThen(obj) { 282 try { 283 return obj.then; 284 } catch (ex) { 285 LAST_ERROR = ex; 286 return IS_ERROR; 287 } 288} 289 290function tryCallOne(fn, a) { 291 try { 292 return fn(a); 293 } catch (ex) { 294 LAST_ERROR = ex; 295 return IS_ERROR; 296 } 297} 298function tryCallTwo(fn, a, b) { 299 try { 300 fn(a, b); 301 } catch (ex) { 302 LAST_ERROR = ex; 303 return IS_ERROR; 304 } 305} 306 307module.exports = Promise; 308 309function Promise(fn) { 310 if (typeof this !== 'object') { 311 throw new TypeError('Promises must be constructed via new'); 312 } 313 if (typeof fn !== 'function') { 314 throw new TypeError('Promise constructor\'s argument is not a function'); 315 } 316 this._U = 0; 317 this._V = 0; 318 this._W = null; 319 this._X = null; 320 if (fn === noop) return; 321 doResolve(fn, this); 322} 323Promise._Y = null; 324Promise._Z = null; 325Promise._0 = noop; 326 327Promise.prototype.then = function(onFulfilled, onRejected) { 328 if (this.constructor !== Promise) { 329 return safeThen(this, onFulfilled, onRejected); 330 } 331 var res = new Promise(noop); 332 handle(this, new Handler(onFulfilled, onRejected, res)); 333 return res; 334}; 335 336function safeThen(self, onFulfilled, onRejected) { 337 return new self.constructor(function (resolve, reject) { 338 var res = new Promise(noop); 339 res.then(resolve, reject); 340 handle(self, new Handler(onFulfilled, onRejected, res)); 341 }); 342} 343function handle(self, deferred) { 344 while (self._V === 3) { 345 self = self._W; 346 } 347 if (Promise._Y) { 348 Promise._Y(self); 349 } 350 if (self._V === 0) { 351 if (self._U === 0) { 352 self._U = 1; 353 self._X = deferred; 354 return; 355 } 356 if (self._U === 1) { 357 self._U = 2; 358 self._X = [self._X, deferred]; 359 return; 360 } 361 self._X.push(deferred); 362 return; 363 } 364 handleResolved(self, deferred); 365} 366 367function handleResolved(self, deferred) { 368 asap(function() { 369 var cb = self._V === 1 ? deferred.onFulfilled : deferred.onRejected; 370 if (cb === null) { 371 if (self._V === 1) { 372 resolve(deferred.promise, self._W); 373 } else { 374 reject(deferred.promise, self._W); 375 } 376 return; 377 } 378 var ret = tryCallOne(cb, self._W); 379 if (ret === IS_ERROR) { 380 reject(deferred.promise, LAST_ERROR); 381 } else { 382 resolve(deferred.promise, ret); 383 } 384 }); 385} 386function resolve(self, newValue) { 387 // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure 388 if (newValue === self) { 389 return reject( 390 self, 391 new TypeError('A promise cannot be resolved with itself.') 392 ); 393 } 394 if ( 395 newValue && 396 (typeof newValue === 'object' || typeof newValue === 'function') 397 ) { 398 var then = getThen(newValue); 399 if (then === IS_ERROR) { 400 return reject(self, LAST_ERROR); 401 } 402 if ( 403 then === self.then && 404 newValue instanceof Promise 405 ) { 406 self._V = 3; 407 self._W = newValue; 408 finale(self); 409 return; 410 } else if (typeof then === 'function') { 411 doResolve(then.bind(newValue), self); 412 return; 413 } 414 } 415 self._V = 1; 416 self._W = newValue; 417 finale(self); 418} 419 420function reject(self, newValue) { 421 self._V = 2; 422 self._W = newValue; 423 if (Promise._Z) { 424 Promise._Z(self, newValue); 425 } 426 finale(self); 427} 428function finale(self) { 429 if (self._U === 1) { 430 handle(self, self._X); 431 self._X = null; 432 } 433 if (self._U === 2) { 434 for (var i = 0; i < self._X.length; i++) { 435 handle(self, self._X[i]); 436 } 437 self._X = null; 438 } 439} 440 441function Handler(onFulfilled, onRejected, promise){ 442 this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; 443 this.onRejected = typeof onRejected === 'function' ? onRejected : null; 444 this.promise = promise; 445} 446 447/** 448 * Take a potentially misbehaving resolver function and make sure 449 * onFulfilled and onRejected are only called once. 450 * 451 * Makes no guarantees about asynchrony. 452 */ 453function doResolve(fn, promise) { 454 var done = false;
455 var res = tryCallTwo(fn, function (value) { 456 if (done) return; 457 done = true; 458 resolve(promise, value); 459 }, function (reason) { 460 if (done) return; 461 done = true; 462 reject(promise, reason); 463 }); 464 if (!done && res === IS_ERROR) { 465 done = true; 466 reject(promise, LAST_ERROR); 467 } 468} 469 470////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 471 472}}},"asap":{
472"package.json":function module(require,exports,module){ 473 474////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 475// // 476// node_modules/meteor/promise/node_modules/asap/package.json // 477// // 478////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 479 // 480module.exports = { 481 "name": "asap", 482 "version": "2.0.6", 483 "browser": { 484 "./asap": "./browser-asap.js", 485 "./asap.js": "./browser-asap.js", 486 "./raw": "./browser-raw.js", 487 "./raw.js": "./browser-raw.js", 488 "./test/domain.js": "./test/browser-domain.js" 489 }, 490 "main": "./asap.js" 491}; 492 493////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 494 495},"raw.js":"/node_modules/meteor/promise/node_modules/asap/browser-raw.js",
495"browser-raw.js":function module(require,exports,module){ 496 497////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 498// // 499// node_modules/meteor/promise/node_modules/asap/browser-raw.js // 500// // 501////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 502 // 503"use strict"; 504 505// Use the fastest means possible to execute a task in its own turn, with 506// priority over other events including IO, animation, reflow, and redraw 507// events in browsers. 508// 509// An exception thrown by a task will permanently interrupt the processing of 510// subsequent tasks. The higher level `asap` function ensures that if an 511// exception is thrown by a task, that the task queue will continue flushing as 512// soon as possible, but if you use `rawAsap` directly, you are responsible to 513// either ensure that no exceptions are thrown from your task, or to manually 514// call `rawAsap.requestFlush` if an exception is thrown. 515module.exports = rawAsap; 516function rawAsap(task) { 517 if (!queue.length) { 518 requestFlush(); 519 flushing = true; 520 } 521 // Equivalent to push, but avoids a function call. 522 queue[queue.length] = task; 523} 524 525var queue = []; 526// Once a flush has been requested, no further calls to `requestFlush` are 527// necessary until the next `flush` completes. 528var flushing = false; 529// `requestFlush` is an implementation-specific method that attempts to kick 530// off a `flush` event as quickly as possible. `flush` will attempt to exhaust 531// the event queue before yielding to the browser's own event loop. 532var requestFlush; 533// The position of the next task to execute in the task queue. This is 534// preserved between calls to `flush` so that it can be resumed if 535// a task throws an exception. 536var index = 0; 537// If a task schedules additional tasks recursively, the task queue can grow 538// unbounded. To prevent memory exhaustion, the task queue will periodically 539// truncate already-completed tasks. 540var capacity = 1024; 541 542// The flush function processes all tasks that have been scheduled with 543// `rawAsap` unless and until one of those tasks throws an exception. 544// If a task throws an exception, `flush` ensures that its state will remain 545// consistent and will resume where it left off when called again. 546// However, `flush` does not make any arrangements to be called again if an 547// exception is thrown. 548function flush() { 549 while (index < queue.length) { 550 var currentIndex = index; 551 // Advance the index before calling the task. This ensures that we will 552 // begin flushing on the next task the task throws an error. 553 index = index + 1; 554 queue[currentIndex].call(); 555 // Prevent leaking memory for long chains of recursive calls to `asap`. 556 // If we call `asap` within tasks scheduled by `asap`, the queue will 557 // grow, but to avoid an O(n) walk for every task we execute, we don't 558 // shift tasks off the queue after they have been executed. 559 // Instead, we periodically shift 1024 tasks off the queue. 560 if (index > capacity) { 561 // Manually shift all values starting at the index back to the 562 // beginning of the queue. 563 for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) { 564 queue[scan] = queue[scan + index]; 565 } 566 queue.length -= index; 567 index = 0; 568 } 569 } 570 queue.length = 0; 571 index = 0; 572 flushing = false; 573} 574 575// `requestFlush` is implemented using a strategy based on data collected from 576// every available SauceLabs Selenium web driver worker at time of writing. 577// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593 578 579// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that 580// have WebKitMutationObserver but not un-prefixed MutationObserver. 581// Must use `global` or `self` instead of `window` to work in both frames and web 582// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop. 583 584/* globals self */ 585var scope = typeof global !== "undefined" ? global : self; 586var BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver; 587 588// MutationObservers are desirable because they have high priority and work 589// reliably everywhere they are implemented. 590// They are implemented in all modern browsers. 591// 592// - Android 4-4.3 593// - Chrome 26-34 594// - Firefox 14-29 595// - Internet Explorer 11 596// - iPad Safari 6-7.1 597// - iPhone Safari 7-7.1 598// - Safari 6-7 599if (typeof BrowserMutationObserver === "function") { 600 requestFlush = makeRequestCallFromMutationObserver(flush); 601 602// MessageChannels are desirable because they give direct access to the HTML 603// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera 604// 11-12, and in web workers in many engines. 605// Although message channels yield to any queued rendering and IO tasks, they 606// would be better than imposing the 4ms delay of timers. 607// However, they do not work reliably in Internet Explorer or Safari. 608 609// Internet Explorer 10 is the only browser that has setImmediate but does 610// not have MutationObservers. 611// Although setImmediate yields to the browser's renderer, it would be 612// preferrable to falling back to setTimeout since it does not have 613// the minimum 4ms penalty. 614// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (
614and 615// Desktop to a lesser extent) that renders both setImmediate and 616// MessageChannel useless for the purposes of ASAP. 617// https://github.com/kriskowal/q/issues/396 618 619// Timers are implemented universally. 620// We fall back to timers in workers in most engines, and in foreground 621// contexts in the following browsers. 622// However, note that even this simple case requires nuances to operate in a 623// broad spectrum of browsers. 624// 625// - Firefox 3-13 626// - Internet Explorer 6-9 627// - iPad Safari 4.3 628// - Lynx 2.8.7 629} else { 630 requestFlush = makeRequestCallFromTimer(flush); 631} 632 633// `requestFlush` requests that the high priority event queue be flushed as 634// soon as possible. 635// This is useful to prevent an error thrown in a task from stalling the event 636// queue if the exception handled by Node.jsâs 637// `process.on("uncaughtException")` or by a domain. 638rawAsap.requestFlush = requestFlush; 639 640// To request a high priority event, we induce a mutation observer by toggling 641// the text of a text node between "1" and "-1". 642function makeRequestCallFromMutationObserver(callback) { 643 var toggle = 1; 644 var observer = new BrowserMutationObserver(callback); 645 var node = document.createTextNode(""); 646 observer.observe(node, {characterData: true}); 647 return function requestCall() { 648 toggle = -toggle; 649 node.data = toggle; 650 }; 651} 652 653// The message channel technique was discovered by Malte Ubl and was the 654// original foundation for this library. 655// http://www.nonblocking.io/2011/06/windownexttick.html 656 657// Safari 6.0.5 (at least) intermittently fails to create message ports on a 658// page's first load. Thankfully, this version of Safari supports 659// MutationObservers, so we don't need to fall back in that case. 660 661// function makeRequestCallFromMessageChannel(callback) { 662// var channel = new MessageChannel(); 663// channel.port1.onmessage = callback; 664// return function requestCall() { 665// channel.port2.postMessage(0); 666// }; 667// } 668 669// For reasons explained above, we are also unable to use `setImmediate` 670// under any circumstances. 671// Even if we were, there is another bug in Internet Explorer 10. 672// It is not sufficient to assign `setImmediate` to `requestFlush` because 673// `setImmediate` must be called *by name* and therefore must be wrapped in a 674// closure. 675// Never forget. 676 677// function makeRequestCallFromSetImmediate(callback) { 678// return function requestCall() { 679// setImmediate(callback); 680// }; 681// } 682 683// Safari 6.0 has a problem where timers will get lost while the user is 684// scrolling. This problem does not impact ASAP because Safari 6.0 supports 685// mutation observers, so that implementation is used instead. 686// However, if we ever elect to use timers in Safari, the prevalent work-around 687// is to add a scroll event listener that calls for a flush. 688 689// `setTimeout` does not call the passed callback if the delay is less than 690// approximately 7 in web workers in Firefox 8 through 18, and sometimes not 691// even then. 692 693function makeRequestCallFromTimer(callback) { 694 return function requestCall() { 695 // We dispatch a timeout with a specified delay of 0 for engines that 696 // can reliably accommodate that request. This will usually be snapped 697 // to a 4 milisecond delay, but once we're flushing, there's no delay 698 // between events. 699 var timeoutHandle = setTimeout(handleTimer, 0); 700 // However, since this timer gets frequently dropped in Firefox 701 // workers, we enlist an interval handle that will try to fire 702 // an event 20 times per second until it succeeds. 703 var intervalHandle = setInterval(handleTimer, 50); 704 705 function handleTimer() { 706 // Whichever timer succeeds will cancel both timers and 707 // execute the callback. 708 clearTimeout(timeoutHandle); 709 clearInterval(intervalHandle); 710 callback(); 711 } 712 }; 713} 714 715// This is for `asap.js` only. 716// Its name will be periodically randomized to break any code that depends on 717// its existence. 718rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer; 719 720// ASAP was originally a nextTick shim included in Q. This was factored out 721// into this ASAP package. It was later adapted to RSVP which made further 722// amendments. These decisions, particularly to marginalize MessageChannel and 723// to capture the MutationObserver implementation in a closure, were integrated 724// back into ASAP proper. 725// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js 726 727////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 728 729}
729}}}}}},{ 730 "extensions": [ 731 ".js", 732 ".json" 733 ] 734}); 735 736 737/* Exports */ 738return { 739 export: function () { return { 740 Promise: Promise 741 };}, 742 require: require, 743 eagerModulePaths: [ 744 "/node_modules/meteor/promise/modern.js", 745 "/node_modules/meteor/promise/legacy.js", 746 "/node_modules/meteor/promise/client.js" 747 ], 748 mainModulePath: "/node_modules/meteor/promise/client.js" 749}});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.