| 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 var foo = new JsThing('made in JS'); | 5 var foo = new JsThing('made in JS'); |
| 6 var aString = 'hello'; | 6 var aString = 'hello'; |
| 7 var aNum = 123; | 7 var aNum = 123; |
| 8 var aBool = true; | 8 var aBool = true; |
| 9 var aDate = new Date(2014, 9, 4); | 9 var aDate = new Date(2014, 9, 4); |
| 10 var a = null; | 10 var a = null; |
| 11 | 11 |
| 12 function JsThing(name) { | 12 function JsThing(name) { |
| 13 this.name = name; | 13 this.name = name; |
| 14 this.bar = null; | 14 this.bar = null; |
| 15 } | 15 } |
| 16 | 16 |
| 17 JsThing.prototype.double = function(x) { | 17 JsThing.prototype.double = function(x) { |
| 18 return x+x; | 18 return x+x; |
| 19 } | 19 } |
| 20 | 20 |
| 21 JsThing.prototype.getName = function(o) { | 21 JsThing.prototype.getName = function(o) { |
| 22 return o.name; | 22 return o.name; |
| 23 } | 23 } |
| 24 | 24 |
| 25 JsThing.prototype.setBar = function(bar) { | 25 JsThing.prototype.setBar = function(bar) { |
| 26 this.bar = bar; | 26 this.bar = bar; |
| 27 } | 27 } |
| 28 | 28 |
| 29 JsThing.prototype.toString = function() { |
| 30 return this.name; |
| 31 } |
| 32 |
| 29 function JsThing2(name) { | 33 function JsThing2(name) { |
| 30 this.name = name; | 34 this.name = name; |
| 31 this.y = 42; | 35 this.y = 42; |
| 32 } | 36 } |
| 33 | 37 |
| 34 JsThing2.prototype = new JsThing(); | 38 JsThing2.prototype = new JsThing(); |
| 35 JsThing2.prototype.constructor = JsThing2; | 39 JsThing2.prototype.constructor = JsThing2; |
| 36 | 40 |
| 37 function createExportMe() { | 41 function createExportMe() { |
| 38 return new dart.test.library.ExportMe(); | 42 return new dart.test.library.ExportMe(); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 e.setter = v; | 98 e.setter = v; |
| 95 } | 99 } |
| 96 | 100 |
| 97 function roundTrip(e) { | 101 function roundTrip(e) { |
| 98 return e; | 102 return e; |
| 99 } | 103 } |
| 100 | 104 |
| 101 function isNull(value) { | 105 function isNull(value) { |
| 102 return value === null; | 106 return value === null; |
| 103 } | 107 } |
| OLD | NEW |