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

Unified Diff: pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart

Issue 932523004: Fix Function.apply for static functions in new emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart b/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
index d6272700206cab5d3a90d3da3aff06ba682a3717..be882963cd7fbf37415b89069eeb8c766e351e54 100644
--- a/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
@@ -128,6 +128,8 @@ class ModelEmitter {
emitStaticNonFinalFields(fragment.staticNonFinalFields),
'operatorIsPrefix': js.string(namer.operatorIsPrefix),
'callName': js.string(namer.callNameField),
+ 'argCnt': js.string(namer.requiredParameterField),
floitsch 2015/02/20 09:07:01 use non-abbreviated names. (I guess the same appl
herhut 2015/02/20 12:24:15 Done.
+ 'defArgValues': js.string(namer.defaultValuesField),
'eagerClasses': emitEagerClassInitializations(fragment.libraries),
'invokeMain': fragment.invokeMain,
'code': code};
@@ -831,7 +833,10 @@ function parseFunctionDescriptor(proto, name, descriptor) {
fun[#callName] = descriptor[1];
holder[name] = fun;
funs = [fun];
- for (var pos = 4; pos < descriptor.length; pos += 3) {
+ // We iterate in blocks of 3 but have to stop before we reach the
+ // (optional) two trailing items. To accomplish this, we only iterate
+ // until we reach length - 2.
+ for (var pos = 4; pos < descriptor.length - 2; pos += 3) {
var stubName = descriptor[pos];
fun = compile(stubName, descriptor[pos + 2]);
fun[#callName] = descriptor[pos + 1];
@@ -843,6 +848,10 @@ function parseFunctionDescriptor(proto, name, descriptor) {
holder[descriptor[2]] =
tearOff(funs, descriptor[3], true, name, false);
}
+ if (descriptor[pos] != null) {
floitsch 2015/02/20 09:07:01 if (pos < descriptor.length) ?
herhut 2015/02/20 12:24:15 Why not :-)
+ fun[#argCnt] = descriptor[pos];
+ fun[#defArgValues] = descriptor[pos + 1];
+ }
}
function setupCompileAllAndDelegateStub(name) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698