| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 function createDartOnly() { | 5 function createDartOnly() { |
| 6 return new dart.test.library2.DartOnly(); | 6 return new dart.test.library2.DartOnly(); |
| 7 } | 7 } |
| 8 | 8 |
| 9 namespace = {}; | 9 namespace = {}; |
| 10 | 10 |
| 11 namespace.Gizmo = function(x) { | 11 namespace.Gizmo = function(x) { |
| 12 this.x = x; | 12 this.x = x; |
| 13 } | 13 } |
| 14 | 14 |
| 15 createGizmo = function(x) { | 15 createGizmo = function(x) { |
| 16 return new namespace.Gizmo(x); | 16 return new namespace.Gizmo(x); |
| 17 } | 17 } |
| 18 | 18 |
| 19 function createJsAndDart(i) { | 19 function createJsAndDart(i) { |
| 20 return new dart.test.library2.JsAndDart(i); | 20 return new dart.test.library2.JsAndDart(i); |
| 21 } | 21 } |
| 22 |
| 23 function createList(a, b, c) { |
| 24 return [a, b, c]; |
| 25 } |
| 26 |
| 27 function joinList(list) { |
| 28 if (!Array.isArray(list)) { |
| 29 throw "Not an Array"; |
| 30 } |
| 31 return list.join(', '); |
| 32 } |
| 33 |
| 34 function joinMap(map) { |
| 35 var pairs = []; |
| 36 var names = Object.keys(map); |
| 37 for (var i in names) { |
| 38 var name = names[i]; |
| 39 var value = map[name] |
| 40 pairs.push(name + ': ' + value); |
| 41 } |
| 42 return pairs.join(', '); |
| 43 } |
| 44 |
| 45 function createMap(k1, v1, k2, v2) { |
| 46 var m = {}; |
| 47 m[k1] = v1; |
| 48 m[k2] = v2; |
| 49 return m; |
| 50 } |
| OLD | NEW |