Skip to content

dart2js compiled code throws Uncaught Error: NullError: Cannot call "call$1" on null #15401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DartBot opened this issue Dec 2, 2013 · 3 comments
Labels
closed-duplicate Closed in favor of an existing report web-dart2js

Comments

@DartBot
Copy link

DartBot commented Dec 2, 2013

This issue was originally filed by [email protected]


1.0.1_r30657 (DEV)
Windows 7x64

The dart2js (pre)compiled version of my app is throwing this error:

Uncaught Error: NullError: Cannot call "call$1" on null main_window.dart.precompiled.js:103735
Stack Trace:
TypeError: Cannot call method 'call$1' of undefined
    at EditableLabel.displayFilter$1 (chrome-extension://ogbfcncmbpliojmfiagabpcojeoonkej/main_window.dart.precompiled.js:116979:33)
    at EditableLabel.set$text (chrome-extension://ogbfcncmbpliojmfiagabpcojeoonkej/main_window.dart.precompiled.js:117000:59)

The generated code in the call stack looks like:

displayFilter$1: function($receiver, arg0) {
      return this.displayFilter.call$1(arg0);
    },

displayText = receiver.displayFilter != null ? this.displayFilter$1(receiver, t) : t;

I think the problem is that it is using 'this' instead of 'receiver' above?

The original dart code looks like:

  if (displayFilter != null) {
    displayText = displayFilter(t);
  }

Where 'displayFilter' is an instance field of a custom element:

Function displayFilter;

thanks,

@DartBot
Copy link
Author

DartBot commented Dec 2, 2013

This comment was originally written by [email protected]


If I hack the generated javascript function to be the following (use $receiver instead of this), then it works:

displayFilter$1: function($receiver, arg0) {
  return $receiver.displayFilter.call$1(arg0);
},

@kasperl
Copy link

kasperl commented Dec 4, 2013

Added Area-Dart2JS, Triaged labels.

@floitschG
Copy link
Contributor

Added Duplicate label.
Marked as being merged into #16068.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report web-dart2js
Projects
None yet
Development

No branches or pull requests

4 participants