| 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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 // | 571 // |
| 572 // We also copy over old values like the prototype, and the | 572 // We also copy over old values like the prototype, and the |
| 573 // isolateProperties themselves. | 573 // isolateProperties themselves. |
| 574 | 574 |
| 575 // function(oldIsolate) { | 575 // function(oldIsolate) { |
| 576 return js.fun('oldIsolate', [ | 576 return js.fun('oldIsolate', [ |
| 577 // var isolateProperties = oldIsolate.${namer.isolatePropertiesName}; | 577 // var isolateProperties = oldIsolate.${namer.isolatePropertiesName}; |
| 578 js['isolateProperties'].def( | 578 js['isolateProperties'].def( |
| 579 js['oldIsolate'][namer.isolatePropertiesName]), | 579 js['oldIsolate'][namer.isolatePropertiesName]), |
| 580 | 580 |
| 581 // isolateProperties.$currentScript = |
| 582 // (typeof document == "object") && (document.currentScript || |
| 583 // document.scripts[document.scripts.length - 1]); |
| 584 js['isolateProperties'][r'$currentScript'].assign( |
| 585 js['document'].typeof.equals(js.string('object')).binary( |
| 586 '&&', |
| 587 js['document']['currentScript'].binary( |
| 588 '||', |
| 589 js['document']['scripts'][ |
| 590 js['document']['scripts']['length'] - 1]))), |
| 591 |
| 581 // var isolatePrototype = oldIsolate.prototype; | 592 // var isolatePrototype = oldIsolate.prototype; |
| 582 js['isolatePrototype'].def(js['oldIsolate']['prototype']), | 593 js['isolatePrototype'].def(js['oldIsolate']['prototype']), |
| 583 | 594 |
| 584 // var str = "{\\n"; | 595 // var str = "{\\n"; |
| 585 js['str'].def(js.string(r'{\n')), | 596 js['str'].def(js.string(r'{\n')), |
| 586 | 597 |
| 587 // str += "var properties = $isolate.${namer.isolatePropertiesName};\\n"; | 598 // str += "var properties = $isolate.${namer.isolatePropertiesName};\\n"; |
| 588 js['str'].update('+', js.string('var properties = ' | 599 js['str'].update('+', js.string('var properties = ' |
| 589 '$isolate.${namer.isolatePropertiesName};' | 600 '$isolate.${namer.isolatePropertiesName};' |
| 590 r'\n')), | 601 r'\n')), |
| (...skipping 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2676 """; | 2687 """; |
| 2677 const String HOOKS_API_USAGE = """ | 2688 const String HOOKS_API_USAGE = """ |
| 2678 // The code supports the following hooks: | 2689 // The code supports the following hooks: |
| 2679 // dartPrint(message) - if this function is defined it is called | 2690 // dartPrint(message) - if this function is defined it is called |
| 2680 // instead of the Dart [print] method. | 2691 // instead of the Dart [print] method. |
| 2681 // dartMainRunner(main) - if this function is defined, the Dart [main] | 2692 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 2682 // method will not be invoked directly. | 2693 // method will not be invoked directly. |
| 2683 // Instead, a closure that will invoke [main] is | 2694 // Instead, a closure that will invoke [main] is |
| 2684 // passed to [dartMainRunner]. | 2695 // passed to [dartMainRunner]. |
| 2685 """; | 2696 """; |
| OLD | NEW |