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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 2422293002: Minor tweaks to dart:html for better dart2js codegen (Closed)
Patch Set: Created 4 years, 2 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:
Download patch
« no previous file with comments | « no previous file | tools/dom/templates/html/dart2js/html_dart2js.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 7a937b34dc5000233b46bc0018d3e1b029b99edd..3d4792de636b30c16b2ae7f1e0f9d17b6199c690 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -89,7 +89,8 @@ Window get window => JS('Window', 'window');
/**
* Root node for all content in a web page.
*/
-HtmlDocument get document => JS('HtmlDocument', 'document');
+HtmlDocument get document =>
+ JS('returns:HtmlDocument;depends:none;effects:none;gvn:true', 'document');
// Workaround for tags like <cite> that lack their own Element subclass --
// Dart issue 1990.
@@ -3069,10 +3070,8 @@ class CloseEvent extends Event {
@Native("Comment")
class Comment extends CharacterData {
factory Comment([String data]) {
- if (data != null) {
- return JS('Comment', '#.createComment(#)', document, data);
- }
- return JS('Comment', '#.createComment("")', document);
+ return JS('returns:Comment;depends:none;effects:none;new:true',
+ '#.createComment(#)', document, data == null ? "" : data);
}
// To suppress missing implicit constructor warnings.
factory Comment._() { throw new UnsupportedError("Not supported"); }
@@ -31999,7 +31998,9 @@ class TemplateElement extends HtmlElement {
@DomName('Text')
@Native("Text")
class Text extends CharacterData {
- factory Text(String data) => document._createTextNode(data);
+ factory Text(String data) =>
+ JS('returns:Text;depends:none;effects:none;new:true',
+ '#.createTextNode(#)', document, data);
// To suppress missing implicit constructor warnings.
factory Text._() { throw new UnsupportedError("Not supported"); }
« no previous file with comments | « no previous file | tools/dom/templates/html/dart2js/html_dart2js.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698