Index: tool/input_sdk/private/foreign_helper.dart |
diff --git a/tool/input_sdk/private/foreign_helper.dart b/tool/input_sdk/private/foreign_helper.dart |
index a8314089c3adbe027cf91615759c59e08d966917..7b15a8da094b6c3023adb66652265f26efeec67f 100644 |
--- a/tool/input_sdk/private/foreign_helper.dart |
+++ b/tool/input_sdk/private/foreign_helper.dart |
@@ -281,3 +281,28 @@ String JS_STRING_CONCAT(String a, String b) { |
// This body is unused, only here for type analysis. |
return JS('String', '# + #', a, b); |
} |
+ |
+/// Same `@rest` annotation and `spread` function as in |
+/// `package:js/src/varargs.dart`. |
+/// |
+/// Runtime files cannot import packages, which is why we have an ad-hoc copy. |
+ |
+class _Rest { |
+ const _Rest(); |
+} |
+ |
+const _Rest rest = const _Rest(); |
+ |
+dynamic spread(args) { |
+ throw new StateError( |
+ 'The spread function cannot be called, ' |
+ 'it should be compiled away.'); |
+} |
+ |
+/// This is a compiler intrinsic that gets expanded to the provided type's |
+/// generic constructor (`genericTypeConstructor(Foo)` gives `foolib.Foo$`). |
+genericTypeConstructor(type) { |
+ throw new StateError( |
+ 'This function cannot be called, ' |
+ 'it should be compiled away.'); |
+} |