| 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 part of html; | 5 part of html; |
| 6 | 6 |
| 7 class _Utils { | 7 class _Utils { |
| 8 static double dateTimeToDouble(DateTime dateTime) => | 8 static double dateTimeToDouble(DateTime dateTime) => |
| 9 dateTime.millisecondsSinceEpoch.toDouble(); | 9 dateTime.millisecondsSinceEpoch.toDouble(); |
| 10 static DateTime doubleToDateTime(double dateTime) { | 10 static DateTime doubleToDateTime(double dateTime) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 static bool isMap(obj) => obj is Map; | 40 static bool isMap(obj) => obj is Map; |
| 41 | 41 |
| 42 static Map createMap() => {}; | 42 static Map createMap() => {}; |
| 43 | 43 |
| 44 static makeUnimplementedError(String fileName, int lineNo) { | 44 static makeUnimplementedError(String fileName, int lineNo) { |
| 45 return new UnsupportedError('[info: $fileName:$lineNo]'); | 45 return new UnsupportedError('[info: $fileName:$lineNo]'); |
| 46 } | 46 } |
| 47 | 47 |
| 48 static window() native "Utils_window"; | 48 static window() native "Utils_window"; |
| 49 static print(String message) native "Utils_print"; | 49 static print(String message) native "Utils_print"; |
| 50 static forwardingPrint(String message) native "Utils_forwardingPrint"; |
| 50 static SendPort spawnDomFunctionImpl(Function topLevelFunction) native "Utils_
spawnDomFunction"; | 51 static SendPort spawnDomFunctionImpl(Function topLevelFunction) native "Utils_
spawnDomFunction"; |
| 51 static int _getNewIsolateId() native "Utils_getNewIsolateId"; | 52 static int _getNewIsolateId() native "Utils_getNewIsolateId"; |
| 52 static bool shadowRootSupported(Document document) native "Utils_shadowRootSup
ported"; | 53 static bool shadowRootSupported(Document document) native "Utils_shadowRootSup
ported"; |
| 53 } | 54 } |
| 54 | 55 |
| 55 class _NPObject extends NativeFieldWrapperClass1 { | 56 class _NPObject extends NativeFieldWrapperClass1 { |
| 56 _NPObject.internal(); | 57 _NPObject.internal(); |
| 57 static _NPObject retrieve(String key) native "NPObject_retrieve"; | 58 static _NPObject retrieve(String key) native "NPObject_retrieve"; |
| 58 property(String propertyName) native "NPObject_property"; | 59 property(String propertyName) native "NPObject_property"; |
| 59 invoke(String methodName, [List args = null]) native "NPObject_invoke"; | 60 invoke(String methodName, [List args = null]) native "NPObject_invoke"; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 bool get isEmpty => Maps.isEmpty(this); | 120 bool get isEmpty => Maps.isEmpty(this); |
| 120 } | 121 } |
| 121 | 122 |
| 122 get _printClosure => (s) { | 123 get _printClosure => (s) { |
| 123 try { | 124 try { |
| 124 window.console.log(s); | 125 window.console.log(s); |
| 125 } catch (_) { | 126 } catch (_) { |
| 126 _Utils.print(s); | 127 _Utils.print(s); |
| 127 } | 128 } |
| 128 }; | 129 }; |
| 130 |
| 131 final _forwardingPrintClosure = _Utils.forwardingPrint; |
| OLD | NEW |