OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 // Dart test for testing isolation across multiple script tags. |
| 6 library multiscript; |
| 7 import 'dart:js' as js; |
| 8 |
| 9 class State { |
| 10 // Static stored in Dart so there is a unique value in each Dart DOM isolate. |
| 11 static int sDart = 0; |
| 12 static update() { |
| 13 sDart++; |
| 14 js.context['sJs']++; |
| 15 } |
| 16 |
| 17 // Static stored on the JS side of the world so there is one value for it |
| 18 // across all Dart DOM isolates. |
| 19 static int get sJs => js.context['sJs']; |
| 20 |
| 21 static registerCallback(int index, Function callback) { |
| 22 js.context.callMethod('registerCallback', [index, callback]); |
| 23 } |
| 24 } |
OLD | NEW |