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

Unified Diff: test/codegen/closure.dart

Issue 1630963003: Use a symbol for static length/name (conflicts with Function properties in ES5: cannot redefine Fun… (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: left todo 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 | « lib/src/codegen/js_names.dart ('k') | test/codegen/expect/closure.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/closure.dart
diff --git a/test/codegen/closure.dart b/test/codegen/closure.dart
index d40e8a759476cb00dc1ce07b1106c078aeab547c..cf2cd1ad84588684820e3456f8482d69c242cc77 100644
--- a/test/codegen/closure.dart
+++ b/test/codegen/closure.dart
@@ -1,7 +1,6 @@
library test;
import 'dart:js';
-
typedef void Callback({int i});
class Foo<T> {
@@ -15,7 +14,7 @@ class Foo<T> {
factory Foo.build() => new Foo(1, null);
untyped_method(a, b) {}
-
+
T pass(T t) => t;
String typed_method(
@@ -29,6 +28,15 @@ class Foo<T> {
static named_params(a, {b, c}) {}
+ // Avoid colliding with Function.name & Function.length, as Closure fails to
+ // lower these to ES6 (https://github.com/google/closure-compiler/issues/1460)
+ static name() => 'Foo.name()';
+ static length() => 'Foo.length()';
+
+ static arguments() => 'Foo.arguments()';
+ static caller() => 'Foo.caller()';
+ static callee() => 'Foo.callee()';
+
nullary_method() {}
function_params(int f(x, [y]), g(x, {String y, z}), Callback cb) {
@@ -52,8 +60,14 @@ class Baz extends Foo<int> with Bar {
Baz(int i) : super(i, 123);
}
-void main(args) {}
+void main(args) {
+ print(Foo.name());
+ print(Foo.length());
+ print(Foo.arguments());
+ print(Foo.caller());
+ print(Foo.callee());
+}
const String some_top_level_constant = "abc";
final String some_top_level_final = "abc";
-String some_top_level_var = "abc";
+String some_top_level_var = "abc";
« no previous file with comments | « lib/src/codegen/js_names.dart ('k') | test/codegen/expect/closure.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698