Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
| 6 | 6 |
| 7 // TODO(ahe): Share these with js_helper.dart. | 7 // TODO(ahe): Share these with js_helper.dart. |
| 8 const FUNCTION_INDEX = 0; | 8 const FUNCTION_INDEX = 0; |
| 9 const NAME_INDEX = 1; | 9 const NAME_INDEX = 1; |
| 10 const CALL_NAME_INDEX = 2; | 10 const CALL_NAME_INDEX = 2; |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 360 // object and copy over the members. | 360 // object and copy over the members. |
| 361 jsAst.Statement finishClasses = js.statement('''{ | 361 jsAst.Statement finishClasses = js.statement('''{ |
| 362 function finishClasses(processedClasses) { | 362 function finishClasses(processedClasses) { |
| 363 if (#debugFastObjects) | 363 if (#debugFastObjects) |
| 364 print("Number of classes: " + | 364 print("Number of classes: " + |
| 365 Object.getOwnPropertyNames(processedClasses.collected).length); | 365 Object.getOwnPropertyNames(processedClasses.collected).length); |
| 366 | 366 |
| 367 var allClasses = #allClasses; | 367 var allClasses = #allClasses; |
| 368 | 368 |
| 369 if (#inCspMode) { | 369 if (#inCspMode) { |
| 370 constructors = dart_precompiled(processedClasses.collected); | 370 var constructors = dart_precompiled(processedClasses.collected); |
|
Johnni Winther
2015/01/05 11:23:57
Why do we need to store it?
| |
| 371 } | 371 } |
| 372 | 372 |
| 373 if (#notInCspMode) { | 373 if (#notInCspMode) { |
| 374 processedClasses.combinedConstructorFunction += | 374 processedClasses.combinedConstructorFunction += |
| 375 "return [\\n" + processedClasses.constructorsList.join(",\\n ") + | 375 "return [\\n" + processedClasses.constructorsList.join(",\\n ") + |
| 376 "\\n]"; | 376 "\\n]"; |
| 377 var constructors = | 377 var constructors = |
| 378 new Function("\$collectedClasses", | 378 new Function("\$collectedClasses", |
| 379 processedClasses.combinedConstructorFunction) | 379 processedClasses.combinedConstructorFunction) |
| 380 (processedClasses.collected); | 380 (processedClasses.collected); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 559 (function() { | 559 (function() { |
| 560 var result = $array[$index]; | 560 var result = $array[$index]; |
| 561 if ($check) { | 561 if ($check) { |
| 562 throw new Error( | 562 throw new Error( |
| 563 name + ": expected value of type \'$type\' at index " + ($index) + | 563 name + ": expected value of type \'$type\' at index " + ($index) + |
| 564 " but got " + (typeof result)); | 564 " but got " + (typeof result)); |
| 565 } | 565 } |
| 566 return result; | 566 return result; |
| 567 })()'''; | 567 })()'''; |
| 568 } | 568 } |
| OLD | NEW |