PageSourceSearch

https://dorsetcountymuseum.org/packages/core-runtime.js?hash=3b2d5bc93e0bc136ceb74acf849a6a280875724c

js dorsetcountymuseum.org collected 2026-09-24 09:56:37 UTC 8,113 bytes, 259 lines download raw bytes

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
11(function() {
12
13(function(){
14
15/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
16//                                                                                                             //
17// packages/core-runtime/package-registry.js                                                                   //
18//                                                                                                             //
19/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
20                                                                                                               //
21function PackageRegistry() {
22  this._promiseInfoMap = Object.create(null);
23}
24
25var PRp = PackageRegistry.prototype;
26
27// Set global.Package[name] = pkg || {}. If additional arguments are
28// supplied, their keys will be copied into pkg if not already present.
29// This method is defined on the prototype of global.Package so that it
30// will not be included in Object.keys(Package).
31PRp._define = function definePackage(name, pkg) {
32  pkg = pkg || {};
33
34  var argc = arguments.length;
35  for (var i = 2; i < argc; ++i) {
36    var arg = arguments[i];
37    for (var s in arg) {
38      if (! (s in pkg)) {
39        pkg[s] = arg[s];
40      }
41    }
42  }
43
44  this[name] = pkg;
45
46  var info = this._promiseInfoMap[name];
47  if (info) {
48    info.resolve(pkg);
49  }
50
51  return pkg;
52};
53
54PRp._has = function has(name) {
55  return Object.prototype.hasOwnProperty.call(this, name);
56};
57
58// Returns a Promise that will resolve to the exports of the named
59// package, or be rejected if the package is not installed.
60PRp._promise = function promise(name) {
61  var self = this;
62  var info = self._promiseInfoMap[name];
63
64  if (! info) {
65    info = self._promiseInfoMap[name] = {};
66    info.promise = new Promise(function (resolve, reject) {
67      info.resolve = resolve;
68      if (self._has(name)) {
69        resolve(self[name]);
70      } else {
71        Meteor.startup(function () {
72          if (! self._has(name)) {
73            reject(new Error("Package " + name + " not installed"));
74          }
75        });
76      }
77    });
78  }
79
80  return info.promise;
81};
82
83// Initialize the Package namespace used by all Meteor packages.
84var global = this;
85global.Package = new PackageRegistry();
86
87if (typeof exports === "object") {
88  // This code is also used by meteor/tools/isobuild/bundler.js.
89  exports.PackageRegistry = PackageRegistry;
90}
91
92/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
93
94}).call(this);
95
96
97
98
99
100
101(function(){
102
103/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
104//                                                                                                             //
105// packages/core-runtime/load-js-image.js                                                                      //
106//                                                                                                             //
107/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
108                                                                                                               //
109// This file needs to work in old web browsers and old node versions
110// It should not use js features newer than EcmaScript 5.
111//
112// Handles loading linked code for packages and apps
113// Ensures packages and eager requires run in the correct order
114// when there is code that uses top level await
115
116var hasOwn = Object.prototype.hasOwnProperty;
117
118var pending = [];
119function queue(name, runImage) {
120  pending.push({name: name, runImage: runImage});
121  processNext();
122}
123
124var isProcessing = false;
125function processNext() {
126  if (isProcessing) {
127    return;
128  }
129
130  var next = pending.shift();
131  if (!next) {
132    return;
133  }
134
135  isProcessing = true;
136
137  var config = next.runImage.call(this);
138  runEagerModules(config, function (mainModuleExports) {
139    // Get the exports after the eager code has been run
140    var exports = config.export ? config.export() : {};
141    if (config.mainModulePath) {
142      Package._define(next.name, mainModuleExports, exports);
143    } else {
144      Package._define(next.name, exports);
145    }
146
147    isProcessing = false;
148    processNext();
149  });
150}
151
152function runEagerModules(config, callback) {
153  if (!config.eagerModulePaths) {
154    return callback();
155  }
156
157  var index = -1;
158  var mainExports = {};
159  var mainModuleAsync = false;
160
161  function evaluateNextModule() {
162    index += 1;
163    if (index === config.eagerModulePaths.length) {
164      if (mainModuleAsync) {
165        // Now that the package has loaded, mark the main module as sync
166        // This allows other packages and the app to `require` the package
167        // and for it to work the same, regardless of if it uses TLA or not
168        // XXX: this is a temporary hack until we find a better way to do this
169        const reify = config.require('/node_modules/meteor/modules/node_modules/@meteorjs/reify/lib/runtime');
170        reify._requireAsSync(config.mainModulePath);
171      }
172
173      return callback(mainExports);
174    }
175
176    var path = config.eagerModulePaths[index];
177    var exports = config.require(path);
178    if (checkAsyncModule(exports)) {
179      if (path === config.mainModulePath) {
180        mainModuleAsync = true;
181      }
182
183      // Is an async module
184      exports.then(function (exports) {
185        if (path === config.mainModulePath) {
186          mainExports = exports;
187        }
188        evaluateNextModule();
189      })
190      // This also handles errors in modules and packages loaded sync
191      // afterwards since they are run within the `.then`.
192      .catch(function (error) {
193        if (
194          typeof process === 'object' &&
195          typeof process.nextTick === 'function'
196        ) {
197          // Is node.js
198          process.nextTick(function () {
199            throw error;
200          });
201        } else {
202          // TODO: is there a faster way to throw the error?
203          setTimeout(function () {
204            throw error;
205          }, 0);
206        }
207      });
208    } else {
209      if (path === config.mainModulePath) {
210        mainExports = exports;
211      }
212      evaluateNextModule();
213    }
214  }
215
216  evaluateNextModule();
217}
218
219function checkAsyncModule (exports) {
220  var potentiallyAsync = exports && typeof exports === 'object' &&
221    hasOwn.call(exports, '__reifyAsyncModule');
222
223  if (!potentiallyAsync) {
224    return;
225  }
226
227  return typeof exports.then === 'function';
228}
229
230// For this to be accurate, all linked files must be queued before calling this
231// If all are loaded, returns null. Otherwise, returns a promise
232function waitUntilAllLoaded() {
233  if (pending.length === 0 && !isProcessing) {
234    // All packages are loaded
235    // If there were no async packages, then there might not be a promise
236    // polyfill loaded either, so we don't create a promise to return
237    return null;
238  }
239
240  return new Promise(function (resolve) {
241    queue(null, function () {
242      resolve();
243      return {};
244    });
245  });
246}
247
248// Since the package.js doesn't export load or waitUntilReady
249// these will never be globals in packages or apps that depend on core-runtime
250Package['core-runtime'] = {
251  queue: queue,
252  waitUntilAllLoaded: waitUntilAllLoaded
253};
254
255/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
256
257}).call(this);
258
259})();

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.