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 js_backend; | 5 part of js_backend; |
6 | 6 |
7 /** | 7 /** |
8 * A function element that represents a closure call. The signature is copied | 8 * A function element that represents a closure call. The signature is copied |
9 * from the given element. | 9 * from the given element. |
10 */ | 10 */ |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 var field = fields[i]; | 185 var field = fields[i]; |
186 field = generateGetterSetter(field, prototype); | 186 field = generateGetterSetter(field, prototype); |
187 str += field; | 187 str += field; |
188 body += "this." + field + " = " + field + ";\\n"; | 188 body += "this." + field + " = " + field + ";\\n"; |
189 } | 189 } |
190 str += ") {" + body + "}\\n"; | 190 str += ") {" + body + "}\\n"; |
191 str += "return " + cls + ";"; | 191 str += "return " + cls + ";"; |
192 constructor = new Function(str)(); | 192 constructor = new Function(str)(); |
193 } | 193 } |
194 constructor.prototype = prototype; | 194 constructor.prototype = prototype; |
| 195 constructor.builtin\$cls = cls; |
195 return constructor; | 196 return constructor; |
196 }"""; | 197 }"""; |
197 } | 198 } |
198 | 199 |
199 /** Needs defineClass to be defined. */ | 200 /** Needs defineClass to be defined. */ |
200 String get protoSupportCheck { | 201 String get protoSupportCheck { |
201 // On Firefox and Webkit browsers we can manipulate the __proto__ | 202 // On Firefox and Webkit browsers we can manipulate the __proto__ |
202 // directly. Opera claims to have __proto__ support, but it is buggy. | 203 // directly. Opera claims to have __proto__ support, but it is buggy. |
203 // So we have to do more checks. | 204 // So we have to do more checks. |
204 // Opera bug was filed as DSK-370158, and fixed as CORE-47615 | 205 // Opera bug was filed as DSK-370158, and fixed as CORE-47615 |
(...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1734 const String HOOKS_API_USAGE = """ | 1735 const String HOOKS_API_USAGE = """ |
1735 // Generated by dart2js, the Dart to JavaScript compiler. | 1736 // Generated by dart2js, the Dart to JavaScript compiler. |
1736 // The code supports the following hooks: | 1737 // The code supports the following hooks: |
1737 // dartPrint(message) - if this function is defined it is called | 1738 // dartPrint(message) - if this function is defined it is called |
1738 // instead of the Dart [print] method. | 1739 // instead of the Dart [print] method. |
1739 // dartMainRunner(main) - if this function is defined, the Dart [main] | 1740 // dartMainRunner(main) - if this function is defined, the Dart [main] |
1740 // method will not be invoked directly. | 1741 // method will not be invoked directly. |
1741 // Instead, a closure that will invoke [main] is | 1742 // Instead, a closure that will invoke [main] is |
1742 // passed to [dartMainRunner]. | 1743 // passed to [dartMainRunner]. |
1743 """; | 1744 """; |
OLD | NEW |