Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: tools/dom/templates/html/impl/impl_Window.darttemplate

Issue 12326132: Removing an unnecessary throw for JS interop. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_Window.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Window.darttemplate b/tools/dom/templates/html/impl/impl_Window.darttemplate
index 083aebd2d559dac2d1867356598f496bf624e79b..682813b9dd77a372278816e4dd13755bf3ffddda 100644
--- a/tools/dom/templates/html/impl/impl_Window.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Window.darttemplate
@@ -20,7 +20,7 @@ $endif
* frame unwinds, causing the future to complete after all processing has
* completed for the current event, but before any subsequent events.
*/
- void setImmediate(TimeoutHandler callback) {
+ void setImmediate(TimeoutHandler callback) {
_addMicrotaskCallback(callback);
}
/**
@@ -28,8 +28,11 @@ $endif
* registered under [name].
*/
SendPortSync lookupPort(String name) {
- var port =
- json.parse(document.documentElement.attributes['dart-port:$name']);
+ var portStr = document.documentElement.attributes['dart-port:$name'];
+ if (portStr == null) {
+ return null;
+ }
+ var port = json.parse(portStr);
return _deserialize(port);
}
@@ -51,7 +54,7 @@ $endif
* If you need to later cancel this animation, use [requestAnimationFrame]
* instead.
*
- * Note: The code that runs when the future completes should call
+ * Note: The code that runs when the future completes should call
* [animationFrame] again for the animation to continue.
*/
Future<num> get animationFrame {
@@ -127,7 +130,7 @@ $if DART2JS
/**
* Called to draw an animation frame and then request the window to repaint
- * after [callback] has finished (creating the animation).
+ * after [callback] has finished (creating the animation).
*
* Use this method only if you need to later call [cancelAnimationFrame]. If
* not, the preferred Dart idiom is to set animation frames by calling
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698