OLD | NEW |
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 // DO NOT EDIT | 5 // DO NOT EDIT |
6 // Auto-generated dart:html library. | 6 // Auto-generated dart:html library. |
7 | 7 |
8 #library("dart:html"); | 8 #library("dart:html"); |
9 | 9 |
10 #import("dart:isolate"); | 10 #import("dart:isolate"); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 ElementList queryAll(String selector) => _document.queryAll(selector); | 62 ElementList queryAll(String selector) => _document.queryAll(selector); |
63 | 63 |
64 int _getNewIsolateId() => _Utils._getNewIsolateId(); | 64 int _getNewIsolateId() => _Utils._getNewIsolateId(); |
65 | 65 |
66 bool _callPortInitialized = false; | 66 bool _callPortInitialized = false; |
67 var _callPortLastResult = null; | 67 var _callPortLastResult = null; |
68 | 68 |
69 _callPortSync(num id, var message) { | 69 _callPortSync(num id, var message) { |
70 if (!_callPortInitialized) { | 70 if (!_callPortInitialized) { |
71 window.on['js-result'].add((event) { | 71 window.on['js-result'].add((event) { |
72 _callPortLastResult = JSON.parse(event.data); | 72 _callPortLastResult = JSON.parse(_getPortSyncEventData(event)); |
73 }, false); | 73 }, false); |
74 _callPortInitialized = true; | 74 _callPortInitialized = true; |
75 } | 75 } |
76 assert(_callPortLastResult == null); | 76 assert(_callPortLastResult == null); |
77 _dispatchEvent('js-sync-message', {'id': id, 'message': message}); | 77 _dispatchEvent('js-sync-message', {'id': id, 'message': message}); |
78 var result = _callPortLastResult; | 78 var result = _callPortLastResult; |
79 _callPortLastResult = null; | 79 _callPortLastResult = null; |
80 return result; | 80 return result; |
81 } | 81 } |
OLD | NEW |