Skip to content

Commit 3f4e5ac

Browse files
authored
Remove generators, clean up REGL intantiation, expose more types. (#2)
* Removing support for generator functions (unused). * Adding traceDeprecation to webpack for debugging deprecation warnings. * Cleaning up REGL instatiation. * Exposing more types via TypeScript module. * Incrementing patch version to 0.1.2.
1 parent be854aa commit 3f4e5ac

24 files changed

+90
-484
lines changed

dist/megaplot-v0.1.1.es2015.min.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 14 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -15476,12 +15476,6 @@ void main () {
1547615476
* See the License for the specific language governing permissions and
1547715477
* limitations under the License.
1547815478
*/
15479-
/**
15480-
* Grab a reference to the JavaScript generator function constructor class.
15481-
* While the Function class is available in the global/window scope, neither
15482-
* GeneratorFunction nor AsyncFunction are available.
15483-
*/
15484-
const GeneratorFunction = (function* () { }).constructor;
1548515479
/**
1548615480
* Default settings to control the WorkScheduler's behavior. These can be
1548715481
* overridden in the WorkScheduler constructor.
@@ -15733,54 +15727,23 @@ void main () {
1573315727
this.futureWorkQueue.enqueueTask(task);
1573415728
continue;
1573515729
}
15736-
// Immediately following this line, either the callback function will be
15737-
// called, or a previously created iterator will be invoked.
1573815730
tasksRan++;
15739-
if (!task.iterator) {
15740-
const result = task.callback.call(null, remaining);
15741-
// Check to see if this was anything other than a generator.
15742-
if (task.callback.constructor !== GeneratorFunction) {
15743-
if (!task.runUntilDone || result) {
15744-
// Task was a simple callback function, nothing left to do.
15745-
continue;
15746-
}
15747-
// Task is not finished, so keep running it until either it finishes
15748-
// or we run out of time.
15749-
let done = result;
15750-
while (!done && remaining() > 0) {
15751-
done = task.callback.call(null, remaining);
15752-
}
15753-
if (!done) {
15754-
// The task did not finish! Schedule the task to continue.
15755-
this.futureWorkQueue.enqueueTask(task);
15756-
}
15757-
continue;
15758-
}
15759-
// Sanity check. At this point, the result value must be an iterator
15760-
// produced by a generator function. Had the callback been a non-
15761-
// generator function, then the loop would have been escaped already
15762-
// from within the preceding block.
15763-
if (!result || typeof result !== 'object' || result === null ||
15764-
!(result.constructor instanceof Function) ||
15765-
result.constructor.constructor !== GeneratorFunction) {
15766-
throw new Error('Generator function did not return an iterator.');
15767-
}
15768-
// Replace the task with a copy but including the iterator for future
15769-
// invocation.
15770-
const iterator = result;
15771-
task = Object.freeze(Object.assign(Object.assign({}, task), { iterator }));
15731+
const result = task.callback.call(null, remaining);
15732+
if (!task.runUntilDone || result) {
15733+
// Task was a simple callback function, nothing left to do.
15734+
continue;
1577215735
}
15773-
// Start running down the iterator until it finishes or time runs out.
15774-
let done = false;
15775-
while (!done) {
15776-
done = task.iterator.next().done;
15777-
if (remaining() <= 0) {
15778-
break;
15779-
}
15736+
// Task is not finished, so keep running it until either it finishes
15737+
// or we run out of time.
15738+
let done = result;
15739+
while (!done && remaining() > 0) {
15740+
done = task.callback.call(null, remaining);
1578015741
}
1578115742
if (!done) {
15782-
// The iterator did not finish! Schedule the task for further work.
15743+
// The task did not finish! Schedule the task to continue later.
1578315744
this.futureWorkQueue.enqueueTask(task);
15745+
// Since the task didn't finish, we must have run out of time.
15746+
break;
1578415747
}
1578515748
}
1578615749
}
@@ -15962,7 +15925,7 @@ void main () {
1596215925
// Look for either the REGL module or createREGL global since both are
1596315926
// supported. The latter is for hot-loading the standalone Regl JS file.
1596415927
const win = window;
15965-
const createREGL = (win['REGL'] || win['createREGL']) || regl;
15928+
const createREGL = win['createREGL'] || regl;
1596615929
if (!createREGL) {
1596715930
throw new Error('Could not find REGL.');
1596815931
}
@@ -16513,4 +16476,4 @@ void main () {
1651316476
Object.defineProperty(exports, '__esModule', { value: true });
1651416477

1651516478
})));
16516-
//# sourceMappingURL=megaplot-v0.1.1.bundle.es2015.js.map
16479+
//# sourceMappingURL=megaplot-v0.1.2.bundle.es2015.js.map
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/megaplot-v0.1.1.bundle.es2015.min.js.map renamed to dist/megaplot-v0.1.2.bundle.es2015.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)