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

Unified Diff: test/codegen/dom.dart

Issue 1013653004: Suppress generation of JsGlobal and JsType code and use window as the default value instead of {} f… (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: ptal Created 5 years, 9 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 | « lib/src/codegen/js_codegen.dart ('k') | test/codegen/expect/dom.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/dom.dart
diff --git a/test/codegen/dom.dart b/test/codegen/dom.dart
index 7ff6bb59ed66270df29fb24f8e12359c8840ee5c..e41c7561f8961bb21dd47998dd585a16ddec6f1e 100644
--- a/test/codegen/dom.dart
+++ b/test/codegen/dom.dart
@@ -2,33 +2,31 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+@JsName(name: 'window')
library dom;
-class JsType {
- /// The JavaScript constructor function name.
- /// Used for construction and instanceof checks.
+
+class JsName {
+ /// The JavaScript name.
+ /// Used for classes and libraries.
/// Note that this could be an expression, e.g. `lib.TypeName` in JS, but it
/// should be kept simple, as it will be generated directly into the code.
final String name;
- const JsType({this.name});
-}
-class JsGlobal {
- const JsGlobal();
+ const JsName({this.name});
}
class Overload {
const Overload();
}
const overload = const Overload();
-@JsGlobal()
-final Document document = null;
+external Document get document;
-@JsType(name: 'Document')
+@JsName(name: 'Document')
abstract class Document {
Element querySelector(String selector);
}
-@JsType(name: 'Element')
+@JsName(name: 'Element')
abstract class Element {
void addEventListener(String type, EventListener callback, [bool capture]);
String textContent;
@@ -38,12 +36,12 @@ typedef void EventListener(Event e);
abstract class Event {}
-@JsType(name: 'HTMLInputElement')
+@JsName(name: 'HTMLInputElement')
abstract class InputElement extends Element {
String value;
}
-@JsType(name: 'HTMLCanvasElement')
+@JsName(name: 'HTMLCanvasElement')
abstract class CanvasElement extends Element {
RenderingContext getContext(String contextId);
}
@@ -53,7 +51,7 @@ abstract class CanvasElement extends Element {
abstract class RenderingContext {}
// http://www.w3.org/html/wg/drafts/2dcontext/html5_canvas_CR/
-@JsType()
+@JsName()
abstract class CanvasRenderingContext2D
implements CanvasDrawingStyles, CanvasPathMethods, RenderingContext {
@@ -169,23 +167,23 @@ abstract class CanvasPathMethods {
[bool anticlockwise]);
}
-@JsType()
+@JsName()
abstract class CanvasGradient {
// opaque object
void addColorStop(num offset, String color);
}
-@JsType()
+@JsName()
abstract class CanvasPattern {
// opaque object
}
-@JsType()
+@JsName()
abstract class TextMetrics {
num get width;
}
-@JsType()
+@JsName()
abstract class ImageData {
int get width;
int get height;
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | test/codegen/expect/dom.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698