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

Unified Diff: test/function_test.ts

Issue 2434903002: Fix crash generating facades for loasd. Fix bug in how we handle TypePredicates. Add test for TypeP… (Closed)
Patch Set: Fix crash generating facades for loasd. Fix bug in how we handle TypePredicates. Add test for TypeP… 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:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « package.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/function_test.ts
diff --git a/test/function_test.ts b/test/function_test.ts
index 01c869603f9859dc9a8ae5ac4ae0d5b33e7ef913..9208fe7f39145e932d658ed1fccdd95f7f517b47 100644
--- a/test/function_test.ts
+++ b/test/function_test.ts
@@ -23,6 +23,14 @@ external x(p1, [num a, num b, p2]);`);
external x();`);
});
+ it('supports type predicates', () => {
+ expectTranslate('function isArrayBuffer(value?: any): value is ArrayBuffer;')
+ .to.equal(`import "dart:typed_data" show ByteBuffer;
+
+@JS()
+external bool /*value is ByteBuffer*/ isArrayBuffer([dynamic value]);`);
+ });
+
it('polyfill var args', () => {
expectTranslate('function x(...a: number[]) { return 42; }').to.equal(`@JS()
external x([num a1, num a2, num a3, num a4, num a5]);`);
« no previous file with comments | « package.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698