| Index: dart/lib/compiler/implementation/js_backend/emitter.dart
|
| diff --git a/dart/lib/compiler/implementation/js_backend/emitter.dart b/dart/lib/compiler/implementation/js_backend/emitter.dart
|
| index 4567d376996fd57482023081176fccba8761c6dd..3c146c527d2313d654345332a7cf0577e2806f2a 100644
|
| --- a/dart/lib/compiler/implementation/js_backend/emitter.dart
|
| +++ b/dart/lib/compiler/implementation/js_backend/emitter.dart
|
| @@ -332,14 +332,6 @@ function(prototype, staticName, fieldName, getterName, lazyValue) {
|
| buffer.add("$isolate = $finishIsolateConstructorName($isolate);\n");
|
| }
|
|
|
| - /**
|
| - * Generate stubs to handle invocation of methods with optional
|
| - * arguments.
|
| - *
|
| - * A method like [: foo([x]) :] may be invoked by the following
|
| - * calls: [: foo(), foo(1), foo(x: 1) :]. See the sources of this
|
| - * function for detailed examples.
|
| - */
|
| void addParameterStub(FunctionElement member,
|
| Selector selector,
|
| DefineMemberFunction defineInstanceMember) {
|
| @@ -1234,37 +1226,20 @@ $mainEnsureGetter
|
| mainCall = '${namer.isolateAccess(main)}()';
|
| }
|
| buffer.add("""
|
| -
|
| -//
|
| -// BEGIN invoke [main].
|
| -//
|
| if (typeof document != 'undefined' && document.readyState != 'complete') {
|
| document.addEventListener('readystatechange', function () {
|
| if (document.readyState == 'complete') {
|
| - if (typeof dartMainRunner == 'function') {
|
| - dartMainRunner(function() { ${mainCall}; });
|
| - } else {
|
| - ${mainCall};
|
| - }
|
| + ${mainCall};
|
| }
|
| }, false);
|
| } else {
|
| - if (typeof dartMainRunner == 'function') {
|
| - dartMainRunner(function() { ${mainCall}; });
|
| - } else {
|
| - ${mainCall};
|
| - }
|
| + ${mainCall};
|
| }
|
| -//
|
| -// END invoke [main].
|
| -//
|
| -
|
| """);
|
| }
|
|
|
| String assembleProgram() {
|
| measure(() {
|
| - mainBuffer.add(HOOKS_API_USAGE);
|
| mainBuffer.add('function ${namer.ISOLATE}() {}\n');
|
| mainBuffer.add('init();\n\n');
|
| // Shorten the code by using "$$" as temporary.
|
| @@ -1333,14 +1308,3 @@ if (typeof document != 'undefined' && document.readyState != 'complete') {
|
| }
|
|
|
| typedef void DefineMemberFunction(String invocationName, CodeBuffer definition);
|
| -
|
| -const String HOOKS_API_USAGE = """
|
| -// Generated by dart2js, the Dart to JavaScript compiler.
|
| -// The code supports the following hooks:
|
| -// dartPrint(message) - if this function is defined it is called
|
| -// instead of the Dart [print] method.
|
| -// dartMainRunner(main) - if this function is defined, the Dart [main]
|
| -// method will not be invoked directly.
|
| -// Instead, a closure that will invoke [main] is
|
| -// passed to [dartMainRunner].
|
| -""";
|
|
|