Index: test/codegen/expect/destructuring.js |
diff --git a/test/codegen/expect/destructuring.js b/test/codegen/expect/destructuring.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..832872dd741d40d046245874f95817a29946b457 |
--- /dev/null |
+++ b/test/codegen/expect/destructuring.js |
@@ -0,0 +1,76 @@ |
+dart_library.library('destructuring', null, /* Imports */[ |
+ 'dart_sdk' |
+], function load__destructuring(exports, dart_sdk) { |
+ 'use strict'; |
+ const core = dart_sdk.core; |
+ const dart = dart_sdk.dart; |
+ const dartx = dart_sdk.dartx; |
+ const destructuring = Object.create(null); |
+ let intAnddynamic__Todynamic = () => (intAnddynamic__Todynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.int, dart.dynamic], [dart.dynamic])))(); |
+ let intAnddynamic__Todynamic$ = () => (intAnddynamic__Todynamic$ = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.int, dart.dynamic], {c: dart.dynamic})))(); |
+ let intAnddynamicTodynamic = () => (intAnddynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.int, dart.dynamic])))(); |
+ let intAnddynamicAnddynamicTodynamic = () => (intAnddynamicAnddynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.int, dart.dynamic, dart.dynamic])))(); |
+ let __Todynamic = () => (__Todynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [], [core.int, dart.dynamic, dart.dynamic])))(); |
+ let __Todynamic$ = () => (__Todynamic$ = dart.constFn(dart.definiteFunctionType(dart.dynamic, [], {let: core.int, function: dart.dynamic, arguments: dart.dynamic})))(); |
+ let __Todynamic$0 = () => (__Todynamic$0 = dart.constFn(dart.definiteFunctionType(dart.dynamic, [], {constructor: core.int, valueOf: dart.dynamic, hasOwnProperty: dart.dynamic})))(); |
+ destructuring.f = function(a, b, c = 1) { |
+ destructuring.f(a, b, c); |
+ }; |
+ dart.fn(destructuring.f, intAnddynamic__Todynamic()); |
+ destructuring.f_sync = function(a, b, c) { |
+ return dart.syncStar(function*(a, b, c = 1) { |
+ }, dart.dynamic, a, b, c); |
+ }; |
+ dart.fn(destructuring.f_sync, intAnddynamic__Todynamic()); |
+ destructuring.f_async = function(a, b, c) { |
+ return dart.asyncStar(function*(stream, a, b, c = 1) { |
+ }, dart.dynamic, a, b, c); |
+ }; |
+ dart.fn(destructuring.f_async, intAnddynamic__Todynamic()); |
+ destructuring.g = function(a, b, {c = 1} = {}) { |
+ destructuring.f(a, b, c); |
+ }; |
+ dart.fn(destructuring.g, intAnddynamic__Todynamic$()); |
+ destructuring.g_sync = function(a, b, opts) { |
+ return dart.syncStar(function*(a, b, {c = 1} = {}) { |
+ }, dart.dynamic, a, b, opts); |
+ }; |
+ dart.fn(destructuring.g_sync, intAnddynamic__Todynamic$()); |
+ destructuring.g_async = function(a, b, opts) { |
+ return dart.asyncStar(function*(stream, a, b, {c = 1} = {}) { |
+ }, dart.dynamic, a, b, opts); |
+ }; |
+ dart.fn(destructuring.g_async, intAnddynamic__Todynamic$()); |
+ destructuring.r = function(a, ...others) { |
+ destructuring.r(a, ...others); |
+ }; |
+ dart.fn(destructuring.r, intAnddynamicTodynamic()); |
+ destructuring.r_sync = function(a, ...others) { |
+ return dart.syncStar(function*(a, ...others) { |
+ }, dart.dynamic, a, ...others); |
+ }; |
+ dart.fn(destructuring.r_sync, intAnddynamicTodynamic()); |
+ destructuring.r_async = function(a, ...others) { |
+ return dart.asyncStar(function*(stream, a, ...others) { |
+ }, dart.dynamic, a, ...others); |
+ }; |
+ dart.fn(destructuring.r_async, intAnddynamicTodynamic()); |
+ destructuring.invalid_names1 = function(let$, func, arguments$) { |
+ destructuring.f(let$, func, arguments$); |
+ }; |
+ dart.fn(destructuring.invalid_names1, intAnddynamicAnddynamicTodynamic()); |
+ destructuring.invalid_names2 = function(let$ = null, func = 1, arguments$ = null) { |
+ destructuring.f(let$, func, arguments$); |
+ }; |
+ dart.fn(destructuring.invalid_names2, __Todynamic()); |
+ destructuring.invalid_names3 = function({["let"]: let$ = null, ["function"]: func = null, ["arguments"]: arguments$ = 2} = {}) { |
+ destructuring.f(let$, func, arguments$); |
+ }; |
+ dart.fn(destructuring.invalid_names3, __Todynamic$()); |
+ destructuring.names_clashing_with_object_props = function({constructor = null, valueOf = null, hasOwnProperty = 2} = Object.create(null)) { |
+ destructuring.f(constructor, valueOf, hasOwnProperty); |
+ }; |
+ dart.fn(destructuring.names_clashing_with_object_props, __Todynamic$0()); |
+ // Exports: |
+ exports.destructuring = destructuring; |
+}); |