-
Notifications
You must be signed in to change notification settings - Fork 1.7k
dart2js: try-catch block fails in IE9 and Firefox #3190
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
Comments
This comment was originally written by @bp74 added another picuture showing the call stack. Attachment: |
This comment was originally written by @bp74 addedd another picture showing the line of code causing the problem. Attachment: |
Added Area-Dart2JS, Triaged labels. |
This is an interesting case because we do have an AudioContext class in dart:html. Do you have any insights on this, Stephen? Is the fact that this "works" in frog by design and is it something we've missed in dart2js? cc @rakudrama. |
The code equivalent to unwrapException in the frog runtime is written in JavaScript. Change this to JS('Object', '#[0]', jsArguments) or something similar. Why does this matter? I expect we will see more cases like this, e.g. the value of the JavaScript 'arguments' special variable is usually not an instance of Array, so it is copied to an Array with Array.prototype.slice.call(arguments) |
Thank you, Stephen. As always, very enlightening. Set owner to @peter-ahe-google. |
CL for review: https://chromiumcodereview.appspot.com/10445032/. |
This comment was originally written by @bp74 Of course i'm happy to test it! I have good and bad news for you :) The bug in this issue is fixed, now the "catch" block is called - which is good! The bad thing is that a new issue came up: But i think we should open a new issue for this. The problem is that the "error" variable in the example above cannot be converted to a String. I have attached three new pictures with the call stack. Attachments: |
This comment was originally written by @bp74 Sorry, forgot to say i have tested with r7992. |
Thanks, Bernhard. Feel free to open a new issue. Looking forward to getting to the bottom of this! |
…2 revisions) https://dart.googlesource.com/dartdoc/+log/a6676ee58628..6b8b1c46da9a 2022-09-27 [email protected] Simplify _buildFullyQualifiedName (#3190) 2022-09-27 [email protected] Simplify Library.dirName (#3192) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/dart-doc-dart-sdk Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Dart Documentation Generator: https://github.com/dart-lang/dartdoc/issues To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md Tbr: [email protected] Change-Id: I5809e94dc7da449a2606414b24785d4ff8b70110 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261460 Reviewed-by: Nate Bosch <[email protected]> Commit-Queue: Nate Bosch <[email protected]> Commit-Queue: DEPS Autoroller <[email protected]>
This issue was originally filed by @bp74
What steps will reproduce the problem?
import('dart:html');
void main() {
AudioContext audioContext;
try {
audioContext = new AudioContext();
}
catch(final error) {
print(error);
}
}
What is the expected output? What do you see instead?
The code above should throw an exception in IE9 and Firefox, because "AudioContext" is not available in this browsers. Unfortunately the JavaScript generated by dart2js fails with an error. The same code compiled with "frog" works fine. This is the error you get in dart2js:
SCRIPT5007: Unable to get value of the property 'operator$index$1': object is null or undefined
Attached to this issue is a picture of the JavaScript debugger, showing the code where the error happens.
What version of the product are you using? On what operating system?
Dart Editor 7916 32 bit, Windows 7 64 bit
Attachment:
debug.png (56.08 KB)
The text was updated successfully, but these errors were encountered: