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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 412 'notInCspMode': !compiler.useContentSecurityPolicy}); | 412 'notInCspMode': !compiler.useContentSecurityPolicy}); |
| 413 | 413 |
| 414 List<jsAst.Statement> incrementalSupport = <jsAst.Statement>[]; | 414 List<jsAst.Statement> incrementalSupport = <jsAst.Statement>[]; |
| 415 if (compiler.hasIncrementalSupport) { | 415 if (compiler.hasIncrementalSupport) { |
| 416 incrementalSupport.add( | 416 incrementalSupport.add( |
| 417 js.statement( | 417 js.statement( |
| 418 r'self.$dart_unsafe_eval.addStubs = addStubs;')); | 418 r'self.$dart_unsafe_eval.addStubs = addStubs;')); |
| 419 } | 419 } |
| 420 | 420 |
| 421 return js(''' | 421 return js(''' |
| 422 (function (reflectionData) { | 422 function parseReflectionData(reflectionData) { |
|
floitsch
2015/01/05 13:46:19
Use the shared name.
I guess the dependency should
zarah
2015/01/05 14:00:26
Done.
| |
| 423 "use strict"; | 423 "use strict"; |
| 424 #header; | 424 #header; |
| 425 if (#needsClassSupport) { | 425 if (#needsClassSupport) { |
| 426 #defineClass; | 426 #defineClass; |
| 427 #inheritFrom; | 427 #inheritFrom; |
| 428 #finishClasses; | 428 #finishClasses; |
| 429 #processClassData; | 429 #processClassData; |
| 430 } | 430 } |
| 431 #processStatics; | 431 #processStatics; |
| 432 #addStubs; | 432 #addStubs; |
| 433 #tearOffCode; | 433 #tearOffCode; |
| 434 #incrementalSupport; | 434 #incrementalSupport; |
| 435 #init; | 435 #init; |
| 436 })''', { | 436 }''', { |
| 437 'header': header, | 437 'header': header, |
| 438 'defineClass': oldEmitter.defineClassFunction, | 438 'defineClass': oldEmitter.defineClassFunction, |
| 439 'inheritFrom': oldEmitter.buildInheritFrom(), | 439 'inheritFrom': oldEmitter.buildInheritFrom(), |
| 440 'processClassData': processClassData, | 440 'processClassData': processClassData, |
| 441 'processStatics': processStatics, | 441 'processStatics': processStatics, |
| 442 'incrementalSupport': incrementalSupport, | 442 'incrementalSupport': incrementalSupport, |
| 443 'addStubs': addStubs, | 443 'addStubs': addStubs, |
| 444 'tearOffCode': tearOffCode, | 444 'tearOffCode': tearOffCode, |
| 445 'init': init, | 445 'init': init, |
| 446 'finishClasses': finishClasses, | 446 'finishClasses': finishClasses, |
| (...skipping 112 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 |