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

Syntax errors in polymer expression is not reported #20707

Closed
larsbak opened this issue Aug 27, 2014 · 7 comments
Closed

Syntax errors in polymer expression is not reported #20707

larsbak opened this issue Aug 27, 2014 · 7 comments
Assignees
Labels
area-pkg P1 A high priority bug; for example, a single project is unusable or has many test failures

Comments

@larsbak
Copy link

larsbak commented Aug 27, 2014

I inserted a syntax error in a polymer expression:
<paper-radio-group selected="{{selectedIndex ++ ++ }}">
The result when launching the app in Dartium was:
"
  404 Not Found
  Could not find asset web/poly.html in package Poly.
"
no other error messages was displayed in the Dart Editor.

After starting pub serve manually, I finally got the error in polymer parser (below).
The problem is the polymer parser does NOT DEAL with the syntax error.
  _token.kind fails since _token is null after _advance().

Please add unit tests for ensuring syntax errors in polymer expressions are reported!

//Lars

Build error:
    | Transform ScriptCompactor on Poly|web/poly.html threw error: The null object does not have a getter 'kind'.
    |
    | NoSuchMethodError: method not found: 'kind'
    | Receiver: null
    | Arguments: []
    | dart:core-patch/object_patch.dart 45 Object.noSuchMethod
    | http://localhost:58284/packages/polymer_expressions/parser.dart 122:20 Parser._parseUnary
    | http://localhost:58284/packages/polymer_expressions/parser.dart 106:28 Parser._parseBinary
    | http://localhost:58284/packages/polymer_expressions/parser.dart 80:72 Parser._parsePrecedence
    | http://localhost:58284/packages/polymer_expressions/parser.dart 46:52 Parser._parseExpression
    | http://localhost:58284/packages/polymer_expressions/parser.dart 32:28 Parser.parse
    | http://localhost:58284/packages/polymer_expressions/parser.dart 15:56 parse
    | http://localhost:58284/packages/polymer/src/build/script_compactor.dart 642:35 _HtmlExtractor._addExpression
    | http://localhost:58284/packages/polymer/src/build/script_compactor.dart 618:23 _HtmlExtractor._processNormalElement.<fn>
    | dart:collection-patch/collection_patch.dart 967 _HashMap&&_LinkedHashMapMixin.forEach

@dgrove
Copy link
Contributor

dgrove commented Aug 27, 2014

cc @sigmundch.
Set owner to @justinfagnani.
Removed Priority-Unassigned label.
Added Priority-High, Pkg-PolymerExpressions, Triaged labels.

@justinfagnani
Copy link
Contributor

I think there are at least two issues here. First, PolymerExpressions should fix that exception and report better errors, but also ScriptCompactor should never fail to produce an output because PolymerExpressions (or an HTML import, or even bad Dart code in some component) fails. The failure should be localized to the expression or the component.

We're also still using build.dart to report errors tot he editor, which is a completely separate system from transformers. I'm not sure what level of PolymerExpressions errors are reported through build.dart or if the exception in PolymerExpressions crashed it as well.

I'll start in on this specific problem in PolymerExpressions.

@sigmundch
Copy link
Member

Added area-pkg, PolymerMilestone-Next labels.

@kasperl
Copy link

kasperl commented Nov 28, 2014

Removed area-pkg label.
Added Area-Pkg, Accepted labels.

@DartBot
Copy link

DartBot commented Dec 13, 2014

This comment was originally written by robert.w.ha...@gmail.com


For me I get the 404 errors at a different point:

I have this code:

  void _onActiveTabChanged(CustomEvent ev) {
    // ...
  }

  @­override
  void attached() {
    super.attached();
    $['dock-center'].on['active-tab-changed'].listen(_onActiveTabChanged);
  }

The editor doesnt show any errors/warnings for this. But I get an build error:

Build error:Build completed with 1 errors.

Transform ScriptCompactor on gui|web/gui.html threw error: Bad state: invalid symbol name: "_onActiveTabChanged"

Can someone explain why this happens? Should I create another bug?

@sigmundch
Copy link
Member

Hi Robert - the issue you are seeing seems to be a different bug. I moved it to a new entry here: https://code.google.com/p/dart/issues/detail?id=21882

@larsbak larsbak added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures area-pkg labels Dec 15, 2014
@DartBot
Copy link

DartBot commented Jun 5, 2015

This issue has been moved to dart-archive/polymer-dart#512.

@DartBot DartBot closed this as completed Jun 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

6 participants