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

Side by Side Diff: lib/isolate/frog/natives.js

Issue 9967024: fix bug in isolate code, reenable isolate tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 | « lib/isolate/frog/isolateimpl.dart ('k') | tests/isolate/isolate.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Top-level native code needed by the frog compiler 5 // Top-level native code needed by the frog compiler
6 6
7 var $globalThis = this; 7 var $globalThis = this;
8 var $globals = null; 8 var $globals = null;
9 var $globalState = null; 9 var $globalState = null;
10 function $initGlobals(context) { context.isolateStatics = {}; } 10 function $initGlobals(context) { context.isolateStatics = {}; }
11 function $setGlobals(context) { $globals = context.isolateStatics; } 11 function $setGlobals(context) { $globals = context.isolateStatics; }
12 12
13 // Wrap a 0-arg dom-callback to bind it with the current isolate: 13 // Wrap a 0-arg dom-callback to bind it with the current isolate:
14 function $wrap_call$0(fn) { return fn && fn.wrap$call$0(); } 14 function $wrap_call$0(fn) { return fn && fn.wrap$call$0(); }
15 15
16 Function.prototype.wrap$call$0 = function() { 16 Function.prototype.wrap$call$0 = function() {
17 var isolateContext = $globalState.currentContext; 17 var isolateContext = $globalState.currentContext;
18 var self = this; 18 var self = this;
19 this.wrap$0 = function() { 19 this.wrap$0 = function() {
20 isolateContext.eval(self); 20 var res = isolateContext.eval(self);
21 $globalState.topEventLoop.run(); 21 $globalState.topEventLoop.run();
22 return res;
22 }; 23 };
23 this.wrap$call$0 = function() { return this.wrap$0; }; 24 this.wrap$call$0 = function() { return this.wrap$0; };
24 return this.wrap$0; 25 return this.wrap$0;
25 }; 26 };
26 27
27 // Wrap a 1-arg dom-callback to bind it with the current isolate: 28 // Wrap a 1-arg dom-callback to bind it with the current isolate:
28 function $wrap_call$1(fn) { return fn && fn.wrap$call$1(); } 29 function $wrap_call$1(fn) { return fn && fn.wrap$call$1(); }
29 30
30 Function.prototype.wrap$call$1 = function() { 31 Function.prototype.wrap$call$1 = function() {
31 var isolateContext = $globalState.currentContext; 32 var isolateContext = $globalState.currentContext;
32 var self = this; 33 var self = this;
33 this.wrap$1 = function(arg) { 34 this.wrap$1 = function(arg) {
34 isolateContext.eval(function() { self(arg); }); 35 var res = isolateContext.eval(function() { return self(arg); });
35 $globalState.topEventLoop.run(); 36 $globalState.topEventLoop.run();
37 return res;
36 }; 38 };
37 this.wrap$call$1 = function() { return this.wrap$1; }; 39 this.wrap$call$1 = function() { return this.wrap$1; };
38 return this.wrap$1; 40 return this.wrap$1;
39 }; 41 };
OLDNEW
« no previous file with comments | « lib/isolate/frog/isolateimpl.dart ('k') | tests/isolate/isolate.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698