Chromium Code Reviews| 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) { |