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
Comments
cc @sigmundch. |
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. |
Added area-pkg, PolymerMilestone-Next labels. |
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 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? |
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 |
This issue has been moved to dart-archive/polymer-dart#512. |
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
The text was updated successfully, but these errors were encountered: