| 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 class ConstHelper { | |
| 6 static String getConstId(var o) native; | |
| 7 | |
| 8 static String getConstMapId(Map map) native { | |
| 9 StringBuffer sb = new StringBuffer(); | |
| 10 sb.add("m"); | |
| 11 bool first = true; | |
| 12 for (String key in map.getKeys()) { | |
| 13 if (first) { | |
| 14 first = false; | |
| 15 } else { | |
| 16 sb.add(","); | |
| 17 } | |
| 18 sb.add(getConstId(key)); | |
| 19 sb.add(","); | |
| 20 sb.add(getConstId(map[key])); | |
| 21 } | |
| 22 return sb.toString(); | |
| 23 } | |
| 24 } | |
| 25 | |
| 26 class ExceptionHelper { | |
| 27 static NullPointerException createNullPointerException() native { | |
| 28 return new NullPointerException(); | |
| 29 } | |
| 30 | |
| 31 static ObjectNotClosureException createObjectNotClosureException() native { | |
| 32 return new ObjectNotClosureException(); | |
| 33 } | |
| 34 | |
| 35 static NoSuchMethodException createNoSuchMethodException( | |
| 36 receiver, functionName, arguments) native { | |
| 37 return new NoSuchMethodException(receiver, functionName, arguments); | |
| 38 } | |
| 39 | |
| 40 static TypeError createTypeError(String srcType, String dstType) native { | |
| 41 return new TypeError(srcType, dstType); | |
| 42 } | |
| 43 | |
| 44 static AssertionError createAssertionError() native { | |
| 45 return new AssertionError(); | |
| 46 } | |
| 47 } | |
| 48 | |
| 49 class _CoreJsUtil { | |
| 50 static Map _newMapLiteral() native { | |
| 51 return new LinkedHashMap(); | |
| 52 } | |
| 53 } | |
| 54 | |
| OLD | NEW |