Skip to content
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

dart2js with csp mode: null reference error in IE 10-11 #23623

Closed
maxwellpeterson-wf opened this issue Jun 11, 2015 · 1 comment
Closed

dart2js with csp mode: null reference error in IE 10-11 #23623

maxwellpeterson-wf opened this issue Jun 11, 2015 · 1 comment

Comments

@maxwellpeterson-wf
Copy link

We are experiencing an issue running a project in IE10 and IE11 using compiled JS from dart2js with CSP mode enabled. I have created a reduced test-case that exhibits the issue with no external dependencies:

pubspec.yaml

name: dart_ie_csp
transformers:
- $dart2js:
     csp: true

web/index.dart

import 'dart:html';

main() {
  querySelector('#content').innerHtml = 'Hello IE!';
}

web/index.html

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>

<div id="content"></div>
<script src="index.dart.js"></script>

</body>
</html>

The resulting error (in IE11):
sc

In the image above, constructor.name is null, which causes cls to be null, etc.
sc2

Simply switching CSP mode to false in the pubspec.yaml fixes the issue. However, we do require CSP-compliant JS in our production applications so this has become a roadblock.

@floitschG
Copy link
Contributor

Just filed a cherry-pick request: #23660

floitschG added a commit that referenced this issue Jun 18, 2015
IE does not have a "name" field on functions. Therefore we set it, if it's missing. However, the test doing that ("name" in constructor) was not using the right precedences.

Fixes #23623.

BUG= http://dartbug.com/23623
R=herhut@google.com

Review URL: https://codereview.chromium.org//1189983004.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants