| OLD | NEW |
| 1 library html; | 1 library html; |
| 2 | 2 |
| 3 import 'dart:isolate'; | 3 import 'dart:isolate'; |
| 4 import 'dart:json'; | 4 import 'dart:json'; |
| 5 import 'dart:svg' as svg; | 5 import 'dart:svg' as svg; |
| 6 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 6 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 7 // for details. All rights reserved. Use of this source code is governed by a | 7 // for details. All rights reserved. Use of this source code is governed by a |
| 8 // BSD-style license that can be found in the LICENSE file. | 8 // BSD-style license that can be found in the LICENSE file. |
| 9 | 9 |
| 10 // DO NOT EDIT | 10 // DO NOT EDIT |
| (...skipping 23627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 23638 if (isPrimitive(x)) return visitPrimitive(x); | 23638 if (isPrimitive(x)) return visitPrimitive(x); |
| 23639 if (x is List) return visitList(x); | 23639 if (x is List) return visitList(x); |
| 23640 if (x is Map) return visitMap(x); | 23640 if (x is Map) return visitMap(x); |
| 23641 if (x is SendPort) return visitSendPort(x); | 23641 if (x is SendPort) return visitSendPort(x); |
| 23642 if (x is SendPortSync) return visitSendPortSync(x); | 23642 if (x is SendPortSync) return visitSendPortSync(x); |
| 23643 | 23643 |
| 23644 // Overridable fallback. | 23644 // Overridable fallback. |
| 23645 return visitObject(x); | 23645 return visitObject(x); |
| 23646 } | 23646 } |
| 23647 | 23647 |
| 23648 abstract visitPrimitive(x); | 23648 visitPrimitive(x); |
| 23649 abstract visitList(List x); | 23649 visitList(List x); |
| 23650 abstract visitMap(Map x); | 23650 visitMap(Map x); |
| 23651 abstract visitSendPort(SendPort x); | 23651 visitSendPort(SendPort x); |
| 23652 abstract visitSendPortSync(SendPortSync x); | 23652 visitSendPortSync(SendPortSync x); |
| 23653 | 23653 |
| 23654 visitObject(Object x) { | 23654 visitObject(Object x) { |
| 23655 // TODO(floitsch): make this a real exception. (which one)? | 23655 // TODO(floitsch): make this a real exception. (which one)? |
| 23656 throw "Message serialization: Illegal value $x passed"; | 23656 throw "Message serialization: Illegal value $x passed"; |
| 23657 } | 23657 } |
| 23658 | 23658 |
| 23659 static bool isPrimitive(x) { | 23659 static bool isPrimitive(x) { |
| 23660 return (x == null) || (x is String) || (x is num) || (x is bool); | 23660 return (x == null) || (x is String) || (x is num) || (x is bool); |
| 23661 } | 23661 } |
| 23662 } | 23662 } |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 23793 int len = keys.length; | 23793 int len = keys.length; |
| 23794 assert(len == values.length); | 23794 assert(len == values.length); |
| 23795 for (int i = 0; i < len; i++) { | 23795 for (int i = 0; i < len; i++) { |
| 23796 var key = _deserializeHelper(keys[i]); | 23796 var key = _deserializeHelper(keys[i]); |
| 23797 var value = _deserializeHelper(values[i]); | 23797 var value = _deserializeHelper(values[i]); |
| 23798 result[key] = value; | 23798 result[key] = value; |
| 23799 } | 23799 } |
| 23800 return result; | 23800 return result; |
| 23801 } | 23801 } |
| 23802 | 23802 |
| 23803 abstract deserializeSendPort(List x); | 23803 deserializeSendPort(List x); |
| 23804 | 23804 |
| 23805 deserializeObject(List x) { | 23805 deserializeObject(List x) { |
| 23806 // TODO(floitsch): Use real exception (which one?). | 23806 // TODO(floitsch): Use real exception (which one?). |
| 23807 throw "Unexpected serialized object"; | 23807 throw "Unexpected serialized object"; |
| 23808 } | 23808 } |
| 23809 } | 23809 } |
| 23810 | 23810 |
| 23811 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 23811 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 23812 // for details. All rights reserved. Use of this source code is governed by a | 23812 // for details. All rights reserved. Use of this source code is governed by a |
| 23813 // BSD-style license that can be found in the LICENSE file. | 23813 // BSD-style license that can be found in the LICENSE file. |
| (...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 24844 if (length < 0) throw new ArgumentError('length'); | 24844 if (length < 0) throw new ArgumentError('length'); |
| 24845 if (start < 0) throw new RangeError.value(start); | 24845 if (start < 0) throw new RangeError.value(start); |
| 24846 int end = start + length; | 24846 int end = start + length; |
| 24847 if (end > a.length) throw new RangeError.value(end); | 24847 if (end > a.length) throw new RangeError.value(end); |
| 24848 for (int i = start; i < end; i++) { | 24848 for (int i = start; i < end; i++) { |
| 24849 accumulator.add(a[i]); | 24849 accumulator.add(a[i]); |
| 24850 } | 24850 } |
| 24851 return accumulator; | 24851 return accumulator; |
| 24852 } | 24852 } |
| 24853 } | 24853 } |
| OLD | NEW |