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

Side by Side Diff: pkg/template_binding/lib/js/microtask.js

Issue 558673004: update polymer js to 0.4.0 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: review updates Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/template_binding/CHANGELOG.md ('k') | pkg/template_binding/lib/js/node_bind.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
3 * This code may only be used under the BSD style license found at http://polyme r.github.io/LICENSE.txt
4 * The complete set of authors may be found at http://polymer.github.io/AUTHORS. txt
5 * The complete set of contributors may be found at http://polymer.github.io/CON TRIBUTORS.txt
6 * Code distributed by Google as part of the polymer project is also
7 * subject to an additional IP rights grant found at http://polymer.github.io/PA TENTS.txt
8 */
9
10 (function(scope) {
11
12 var iterations = 0;
13 var callbacks = [];
14 var twiddle = document.createTextNode('');
15
16 function endOfMicrotask(callback) {
17 twiddle.textContent = iterations++;
18 callbacks.push(callback);
19 }
20
21 function atEndOfMicrotask() {
22 while (callbacks.length) {
23 callbacks.shift()();
24 }
25 }
26
27 new (window.MutationObserver || JsMutationObserver)(atEndOfMicrotask)
28 .observe(twiddle, {characterData: true})
29 ;
30
31 // exports
32
33 scope.endOfMicrotask = endOfMicrotask;
34
35 })(Platform);
36
OLDNEW
« no previous file with comments | « pkg/template_binding/CHANGELOG.md ('k') | pkg/template_binding/lib/js/node_bind.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698