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

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

Issue 1582443003: Switch to using HashChangeEvent constructor instead of initHashChangeEvent (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | « tests/html/html.status ('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_HashChangeEvent.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_HashChangeEvent.darttemplate b/tools/dom/templates/html/impl/impl_HashChangeEvent.darttemplate
index b9fd424b05028e23ed89781a4b4e97bbc3b865a7..bf7bd07a02341b41c7dc3771afde663abbb6a515 100644
--- a/tools/dom/templates/html/impl/impl_HashChangeEvent.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HashChangeEvent.darttemplate
@@ -9,9 +9,24 @@ $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS
factory $CLASSNAME(String type,
{bool canBubble: true, bool cancelable: true, String oldUrl,
String newUrl}) {
+
+$if DART2JS
+ var options = {
+ 'canBubble' : canBubble,
+ 'cancelable' : cancelable,
+ 'oldURL': oldUrl,
+ 'newURL': newUrl,
+ };
+ return JS('HashChangeEvent', 'new HashChangeEvent(#, #)',
+ type, convertDartToNative_Dictionary(options));
+$else
+ // TODO(alanknight): This is required while we're on Dartium 39, but will need
+ // to look like dart2js with later versions when initHashChange is removed.
var event = document._createEvent("HashChangeEvent");
event._initHashChangeEvent(type, canBubble, cancelable, oldUrl, newUrl);
return event;
+$endif
}
+
$!MEMBERS
}
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698