-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
CCE in CompilationUnitImpl #840
Comments
Set owner to @bwilkerson. |
Removed the owner. |
This comment was originally written by [email protected] Set owner to @jtmcdole. |
This comment was originally written by [email protected] |
I also thought this was a duplicate, but it isn't, it's on the editor side. Set owner to @bwilkerson. |
http://codereview.chromium.org/8914015/ Added Fixed label. |
I'm wondering if the parser should have produced a different AST structure as well. According to this print out, things go off in the bushes fast: ... ... |
It would be ideal if the parser could recognize this as a statement rather than a method declaration (and then issue an error indicating that statements must be contained in methods or functions), but that seems like a fairly large change for this code base when we know it's likely to be replaced. |
I'm going to copy your name extraction and put up a CL for DartC; I'll add you to it as well. |
Converting JS code to Dart is uncovering new bugs. Here's a stack traces. Source is below.
java.lang.ClassCastException: com.google.dart.compiler.ast.DartPropertyAccess cannot be cast to com.google.dart.compiler.ast.DartIdentifier
at com.google.dart.tools.core.internal.model.CompilationUnitImpl$CompilationUnitStructureBuilder.visitMethodDefinition(CompilationUnitImpl.java:290)
at com.google.dart.tools.core.internal.model.CompilationUnitImpl$CompilationUnitStructureBuilder.visitMethodDefinition(CompilationUnitImpl.java:1)
at com.google.dart.compiler.ast.DartMethodDefinition.accept(DartMethodDefinition.java:90)
at com.google.dart.compiler.ast.DartNodeTraverser.visit(DartNodeTraverser.java:413)
at com.google.dart.compiler.ast.DartUnit.visitChildren(DartUnit.java:99)
at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
at com.google.dart.compiler.ast.DartNodeTraverser.visitUnit(DartNodeTraverser.java:391)
at com.google.dart.tools.core.internal.model.CompilationUnitImpl$CompilationUnitStructureBuilder.visitUnit(CompilationUnitImpl.java:324)
at com.google.dart.tools.core.internal.model.CompilationUnitImpl$CompilationUnitStructureBuilder.visitUnit(CompilationUnitImpl.java:1)
at com.google.dart.compiler.ast.DartUnit.accept(DartUnit.java:107)
at com.google.dart.tools.core.internal.model.CompilationUnitImpl.buildStructure(CompilationUnitImpl.java:1519)
at com.google.dart.tools.core.internal.model.OpenableElementImpl.generateInfos(OpenableElementImpl.java:477)
at com.google.dart.tools.core.internal.model.DartElementImpl.openWhenClosed(DartElementImpl.java:520)
at com.google.dart.tools.core.internal.model.CompilationUnitImpl.makeConsistent(CompilationUnitImpl.java:1371)
at com.google.dart.tools.core.internal.operation.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:95)
at com.google.dart.tools.core.internal.operation.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:206)
at com.google.dart.tools.core.internal.operation.DartModelOperation.run(DartModelOperation.java:374)
at com.google.dart.tools.core.internal.operation.DartModelOperation.runOperation(DartModelOperation.java:441)
at com.google.dart.tools.core.internal.model.CompilationUnitImpl.reconcile(CompilationUnitImpl.java:1426)
at com.google.dart.tools.ui.internal.text.dart.DartReconcilingStrategy$1.run(DartReconcilingStrategy.java:159)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at com.google.dart.tools.ui.internal.text.dart.DartReconcilingStrategy.reconcile(DartReconcilingStrategy.java:134)
at com.google.dart.tools.ui.internal.text.dart.DartReconcilingStrategy.reconcile(DartReconcilingStrategy.java:102)
at com.google.dart.tools.ui.internal.text.functions.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:93)
at com.google.dart.tools.ui.internal.text.functions.DartCompositeReconcilingStrategy.reconcile(DartCompositeReconcilingStrategy.java:120)
at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77)
at com.google.dart.tools.ui.internal.text.functions.DartReconciler.process(DartReconciler.java:387)
at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)
import('dart:html');
// Content section used alot
main() {
var content = document.query('content');
if (!window.FileReader) {
content.innerHTML = "<p>This browser doesnt support the File API</p>";
} else {
// Page Layout
content.innerHTML =
'<p>Pick a text file or drag one into this area <br> <input type="file" id="file" /></p>' +
'<p><b>Name:</b> <span id="name"></span><br>' +
'<b>File Size:</b> <span id="size"></span><br>' +
'<b>Content:</b> <br><br> <pre id="file-content"></pre>' +
'</p>';
}
}
// Prints out file properties.
displayFile(file) {
document.query('name').textContent = file.fileName;
document.query('size').textContent = file.fileSize;
document.
document.getElementById('name').textContent = file.fileName;
document.getElementById('size').textContent = file.fileSize;
document.getElementById('file-content').style.border = "1px solid black";
var reader = new FileReader();
reader.onload = function(event) {
document.getElementById('file-content').textContent =
event.target.result;
};
reader.onerror = function() {
document.getElementById('file-content').innerHTML = 'Unable to read ' + file.fileName;
};
reader.readAsText(file);
}
// Input handler
document.getElementById('file').onchange = function() {
displayFile(this.files[0]);
};
// Add invisible border to drop area
content.style.border = '4px solid transparent';
// Add dragging events
content.ondragenter = function() {
content.style.border = '4px solid #b1ecb3';
return false;
};
content.ondragover = function() {
return false;
};
content.ondragleave = function() {
return false;
};
content.ondrop = function(event) {
content.style.border = '4px solid transparent';
displayFile(event.dataTransfer.files[0]);
return false;
};
}
The text was updated successfully, but these errors were encountered: