Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(919)

Unified Diff: src/js/microtaskq.js

Issue 2246963002: [isolate] Remove unused exception handle (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: microtaskq.js Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/isolate.cc ('k') | src/js/prologue.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/microtaskq.js
diff --git a/src/js/microtaskq.js b/src/js/microtaskq.js
new file mode 100644
index 0000000000000000000000000000000000000000..163dee700ca9a684b4dc005a5fc2d08895c9dcb4
--- /dev/null
+++ b/src/js/microtaskq.js
@@ -0,0 +1,45 @@
+// Copyright 2012 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+(function(global, utils, extrasUtils) {
+
+ "use strict";
+
+ %CheckIsBootstrapping();
+
+ // ----------------------------------------------------------
+ // Imports
+
+ let InternalArray = utils.InternalArray;
+
+ // -------------------------------------------------------------------
+
+ let microtaskQ = []
+
+ function MicrotaskEnq(task) {
+ microtaskQ.push(task);
+ }
+
+ function MicrotaskRun() {
+ for( var i = 0; i < microtaskQ.length; i ++) {
+ try {
+ microtaskQ[i]();
+ } catch (e) {}
+ }
+
+ microtaskQ = [];
+ }
+
+ // -------------------------------------------------------------------
+ // Install exported functions.
+
+ utils.Export(function(to) {
+ to.MicrotaskEnq = MicrotaskEnq;
+ });
+
+ %InstallToContext([
+ "microtask_run", MicrotaskRun,
+ "microtask_enq", MicrotaskEnq
+ ]);
+})
« no previous file with comments | « src/isolate.cc ('k') | src/js/prologue.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698