Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: sdk/lib/_internal/compiler/js_lib/js_helper.dart

Issue 767643002: dart2js: Make usage of names more consistent between compiler and runtime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix long lines. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 library _js_helper; 5 library _js_helper;
6 6
7 import 'shared/embedded_names.dart' show 7 import 'shared/embedded_names.dart' show
8 ALL_CLASSES, 8 ALL_CLASSES,
9 GET_ISOLATE_TAG, 9 GET_ISOLATE_TAG,
10 INTERCEPTED_NAMES, 10 INTERCEPTED_NAMES,
(...skipping 2013 matching lines...) Expand 10 before | Expand all | Expand 10 after
2024 '', 2024 '',
2025 'function(f,r){' 2025 'function(f,r){'
2026 'return function(){' 2026 'return function(){'
2027 'return f.apply({\$receiver:r(this)},arguments)' 2027 'return f.apply({\$receiver:r(this)},arguments)'
2028 '}' 2028 '}'
2029 '}(#,#)', functionType, getReceiver); 2029 '}(#,#)', functionType, getReceiver);
2030 } else { 2030 } else {
2031 throw 'Error in reflectionInfo.'; 2031 throw 'Error in reflectionInfo.';
2032 } 2032 }
2033 2033
2034 JS('', '#.\$signature = #', prototype, signatureFunction); 2034 JS('', '#[#] = #', prototype, JS_SIGNATURE_NAME(), signatureFunction);
2035 2035
2036 JS('', '#[#] = #', prototype, callName, trampoline); 2036 JS('', '#[#] = #', prototype, callName, trampoline);
2037 for (int i = 1; i < functions.length; i++) { 2037 for (int i = 1; i < functions.length; i++) {
2038 var stub = functions[i]; 2038 var stub = functions[i];
2039 var stubCallName = JS('String|Null', '#.\$callName', stub); 2039 var stubCallName = JS('String|Null', '#.\$callName', stub);
2040 if (stubCallName != null) { 2040 if (stubCallName != null) {
2041 JS('', '#[#] = #', prototype, stubCallName, 2041 JS('', '#[#] = #', prototype, stubCallName,
2042 isStatic ? stub : forwardCallTo(receiver, stub, isIntercepted)); 2042 isStatic ? stub : forwardCallTo(receiver, stub, isIntercepted));
2043 } 2043 }
2044 } 2044 }
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after
3402 throw new MainError("No top-level function named 'main'."); 3402 throw new MainError("No top-level function named 'main'.");
3403 } 3403 }
3404 3404
3405 void badMain() { 3405 void badMain() {
3406 throw new MainError("'main' is not a function."); 3406 throw new MainError("'main' is not a function.");
3407 } 3407 }
3408 3408
3409 void mainHasTooManyParameters() { 3409 void mainHasTooManyParameters() {
3410 throw new MainError("'main' expects too many parameters."); 3410 throw new MainError("'main' expects too many parameters.");
3411 } 3411 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698