From 7fe1e215454610bca783f2d36ce844be85b79013 Mon Sep 17 00:00:00 2001 From: eladcon Date: Sat, 29 Jun 2024 14:16:18 +0300 Subject: [PATCH] revert: lifting globals from inflight classes defined in preflight fails, take 2" (#6805) Reverts winglang/wing#6801 --- apps/wing/src/commands/pack.test.ts | 1 - ...ight_class_capture_preflight_object.test.w | 64 +- examples/tests/valid/subdir/bar.w | 2 - examples/tests/valid/subdir2/inflight_class.w | 5 - .../src/dtsify/snapshots/declarations.snap | 13 +- .../wingc/src/dtsify/snapshots/optionals.snap | 9 +- libs/wingc/src/jsify.rs | 128 ++- ...methods_and_properties_on_collections.snap | 3 - .../access_property_on_primitive.snap | 3 - ...rty_on_value_returned_from_collection.snap | 3 - .../allow_type_def_before_super.snap | 3 - .../base_class_captures_inflight.snap | 3 - .../base_class_captures_preflight.snap | 3 - .../snapshots/base_class_lift_indirect.snap | 5 +- .../base_class_with_fields_inflight.snap | 3 - .../base_class_with_fields_preflight.snap | 3 - .../base_class_with_lifted_field_object.snap | 5 +- .../base_class_with_lifted_fields.snap | 3 - libs/wingc/src/jsify/snapshots/builtins.snap | 3 - ..._static_inflight_from_static_inflight.snap | 5 - .../calls_methods_on_preflight_object.snap | 5 +- ...pture_from_inside_an_inflight_closure.snap | 5 +- ...entifier_closure_from_preflight_scope.snap | 3 - ...pture_identifier_from_preflight_scope.snap | 3 - ...from_preflight_scope_with_method_call.snap | 3 - ...om_preflight_scope_with_nested_object.snap | 5 +- ...er_from_preflight_scope_with_property.snap | 3 - .../snapshots/capture_in_keyword_args.snap | 7 +- .../capture_object_with_this_in_name.snap | 5 +- .../src/jsify/snapshots/capture_token.snap | 5 +- ...type_inflight_class_sibling_from_init.snap | 3 - ...pe_inflight_class_sibling_from_method.snap | 3 - ...e_new_inflight_class_inner_no_capture.snap | 3 - ...capture_type_new_inflight_class_outer.snap | 7 - .../snapshots/capture_type_static_method.snap | 3 - ...ure_type_static_method_inflight_class.snap | 7 - .../capture_var_from_method_inflight.snap | 3 - ...ht_class_extends_outer_inflight_class.snap | 7 - .../src/jsify/snapshots/closure_field.snap | 5 +- .../src/jsify/snapshots/entrypoint_this.snap | 3 - .../wingc/src/jsify/snapshots/enum_value.snap | 5 - .../free_inflight_obj_from_inflight.snap | 3 - .../free_preflight_object_from_preflight.snap | 3 - .../jsify/snapshots/func_returns_func.snap | 3 - .../src/jsify/snapshots/identify_field.snap | 5 +- .../implicit_lift_inflight_init.snap | 5 +- .../src/jsify/snapshots/indirect_capture.snap | 5 +- ..._extends_both_inside_inflight_closure.snap | 3 - ...inflight_class_extends_inflight_class.snap | 7 - .../jsify/snapshots/inflight_constructor.snap | 3 - .../src/jsify/snapshots/inflight_field.snap | 3 - .../inflight_field_from_inflight.snap | 3 - .../inflight_field_from_inflight_class.snap | 5 - .../snapshots/inline_inflight_class.snap | 5 +- .../src/jsify/snapshots/json_object.snap | 5 - ...ary_preflight_and_inflight_expression.snap | 3 - .../lift_binary_preflight_expression.snap | 3 - ...lift_element_from_collection_as_field.snap | 5 +- ...ft_element_from_collection_of_objects.snap | 5 +- .../snapshots/lift_inflight_closure.snap | 3 - .../lift_inside_preflight_method.snap | 5 +- .../jsify/snapshots/lift_self_reference.snap | 3 - .../src/jsify/snapshots/lift_string.snap | 3 - libs/wingc/src/jsify/snapshots/lift_this.snap | 3 - .../jsify/snapshots/lift_var_with_this.snap | 3 - .../src/jsify/snapshots/lift_via_closure.snap | 5 +- .../lift_via_closure_class_explicit.snap | 5 +- .../namespaced_static_from_inflight.snap | 7 +- ...ed_inflight_after_preflight_operation.snap | 5 +- .../snapshots/nested_preflight_operation.snap | 5 +- .../jsify/snapshots/new_inflight_object.snap | 7 - .../snapshots/no_capture_inside_methods.snap | 3 - ...apture_of_identifier_from_inner_scope.snap | 3 - ...capture_of_identifier_from_same_scope.snap | 3 - ...no_capture_shadow_inside_inner_scopes.snap | 3 - .../no_lift_shadow_inside_inner_scopes.snap | 3 - ...eflight_class_extends_preflight_class.snap | 3 - .../jsify/snapshots/preflight_collection.snap | 3 - ...light_collection_of_preflight_objects.snap | 5 +- ...eflight_nested_object_with_operations.snap | 5 +- .../src/jsify/snapshots/preflight_object.snap | 3 - .../preflight_object_through_property.snap | 5 +- .../preflight_object_with_operations.snap | 5 +- ...ject_with_operations_multiple_methods.snap | 5 +- .../snapshots/preflight_value_field.snap | 3 - ...ht_type_refrencing_preflight_instance.snap | 209 ----- .../jsify/snapshots/read_primitive_value.snap | 3 - .../snapshots/reassign_captured_variable.snap | 3 - ...eassigned_captured_variable_preflight.snap | 3 - .../src/jsify/snapshots/ref_std_macro.snap | 3 - .../reference_from_static_inflight.snap | 3 - .../snapshots/reference_inflight_class.snap | 7 - .../snapshots/reference_inflight_field.snap | 3 - .../reference_inflight_from_inflight.snap | 7 - .../reference_lift_of_collection.snap | 3 - .../snapshots/reference_preflight_field.snap | 3 - ...eflight_field_call_independent_method.snap | 3 - .../snapshots/reference_preflight_fields.snap | 5 +- ..._variable_with_this_in_the_expression.snap | 5 +- ...preflight_object_from_static_inflight.snap | 5 +- .../snapshots/reference_static_inflight.snap | 3 - ...ght_which_references_preflight_object.snap | 5 +- .../static_external_inflight_class.snap | 7 - .../static_external_preflight_class.snap | 3 - .../snapshots/static_inflight_operation.snap | 5 +- .../static_local_inflight_class.snap | 3 - .../jsify/snapshots/static_on_std_type.snap | 7 - .../jsify/snapshots/transitive_reference.snap | 5 +- ...ansitive_reference_via_inflight_class.snap | 11 +- .../transitive_reference_via_static.snap | 5 +- .../jsify/snapshots/two_identical_lifts.snap | 5 +- .../jsify/snapshots/use_util_functions.snap | 7 +- .../var_inflight_field_from_inflight.snap | 3 - libs/wingc/src/jsify/snapshots/wait_util.snap | 7 +- libs/wingc/src/jsify/tests.rs | 23 - libs/wingc/src/lifting.rs | 57 +- libs/wingc/src/lsp/symbol_locator.rs | 2 +- libs/wingc/src/type_check.rs | 129 ++- libs/wingc/src/type_check/jsii_importer.rs | 5 - libs/wingc/src/type_check/lifts.rs | 2 +- libs/wingc/src/visit_context.rs | 8 +- libs/wingsdk/src/core/lifting.ts | 5 +- libs/wingsdk/src/helpers.ts | 61 -- tools/hangar/__snapshots__/invalid.ts.snap | 14 + .../anon_function.test.w_compile_tf-aws.md | 3 - .../valid/api.test.w_compile_tf-aws.md | 7 +- .../api_cors_custom.test.w_compile_tf-aws.md | 27 +- .../api_cors_default.test.w_compile_tf-aws.md | 21 +- .../api_valid_path.test.w_compile_tf-aws.md | 7 +- .../valid/assert.test.w_compile_tf-aws.md | 3 - ...wait_in_functions.test.w_compile_tf-aws.md | 5 +- .../test_corpus/valid/baz.w_compile_tf-aws.md | 3 +- .../bring_alias.test.w_compile_tf-aws.md | 7 +- .../bring_awscdk.test.w_compile_tf-aws.md | 5 +- .../bring_cdk8s.test.w_compile_tf-aws.md | 7 +- .../bring_cdktf.test.w_compile_tf-aws.md | 7 +- ..._extend_non_entry.test.w_compile_tf-aws.md | 8 +- .../valid/bring_jsii.test.w_compile_tf-aws.md | 11 +- .../bring_local.test.w_compile_tf-aws.md | 26 +- .../bring_local_dir.test.w_compile_tf-aws.md | 98 +-- ...cal_normalization.test.w_compile_tf-aws.md | 64 +- .../bring_projen.test.w_compile_tf-aws.md | 5 +- ...ring_wing_library.test.w_compile_tf-aws.md | 36 +- .../bucket_keys.test.w_compile_tf-aws.md | 5 +- .../bypass_return.test.w_compile_tf-aws.md | 3 - ..._static_of_myself.test.w_compile_tf-aws.md | 11 - ...inflight_variants.test.w_compile_tf-aws.md | 3 - ...apture_containers.test.w_compile_tf-aws.md | 5 +- ...capture_in_binary.test.w_compile_tf-aws.md | 5 +- .../capture_mutables.test.w_compile_tf-aws.md | 3 - ...apture_primitives.test.w_compile_tf-aws.md | 5 +- ...gable_class_field.test.w_compile_tf-aws.md | 9 +- ...ture_reassignable.test.w_compile_tf-aws.md | 5 +- ...resource_and_data.test.w_compile_tf-aws.md | 5 +- ..._with_no_inflight.test.w_compile_tf-aws.md | 5 +- .../capture_tokens.test.w_compile_tf-aws.md | 5 +- .../valid/captures.test.w_compile_tf-aws.md | 5 +- .../valid/casting.test.w_compile_tf-aws.md | 9 +- .../valid/class.test.w_compile_tf-aws.md | 13 +- .../closure_class.test.w_compile_tf-aws.md | 3 - .../construct-base.test.w_compile_tf-aws.md | 9 +- .../container_types.test.w_compile_tf-aws.md | 5 +- .../custom_obj_id.test.w_compile_tf-aws.md | 3 - .../valid/debug_env.test.w_compile_tf-aws.md | 5 +- .../deep_equality.test.w_compile_tf-aws.md | 5 - .../double_reference.test.w_compile_tf-aws.md | 5 +- .../valid/doubler.test.w_compile_tf-aws.md | 9 +- .../valid/enums.test.w_compile_tf-aws.md | 7 - ...ift_qualification.test.w_compile_tf-aws.md | 5 +- ..._binary_operators.test.w_compile_tf-aws.md | 3 - ...ing_interpolation.test.w_compile_tf-aws.md | 7 +- .../extend_non_entrypoint.w_compile_tf-aws.md | 3 +- ...rn_implementation.test.w_compile_tf-aws.md | 5 +- .../file_counter.test.w_compile_tf-aws.md | 5 +- .../valid/for_loop.test.w_compile_tf-aws.md | 5 +- .../forward_decl.test.w_compile_tf-aws.md | 3 - ...ptional_arguments.test.w_compile_tf-aws.md | 3 - ..._returns_function.test.w_compile_tf-aws.md | 5 +- .../function_type.test.w_compile_tf-aws.md | 3 - ...ariadic_arguments.test.w_compile_tf-aws.md | 5 +- .../valid/hello.test.w_compile_tf-aws.md | 5 +- ...entical_inflights.test.w_compile_tf-aws.md | 3 - .../impl_interface.test.w_compile_tf-aws.md | 9 +- .../implicit_std.test.w_compile_tf-aws.md | 3 - ...n_scope_construct.test.w_compile_tf-aws.md | 5 +- .../valid/indexing.test.w_compile_tf-aws.md | 7 +- .../valid/inference.test.w_compile_tf-aws.md | 5 +- ...light-subscribers.test.w_compile_tf-aws.md | 5 +- ...ht_capture_static.test.w_compile_tf-aws.md | 11 +- ...as_struct_members.test.w_compile_tf-aws.md | 9 - ...ass_capture_const.test.w_compile_tf-aws.md | 11 +- ..._preflight_object.test.w_compile_tf-aws.md | 746 ------------------ ...apture_preflight_object.test.w_test_sim.md | 8 +- ...class_definitions.test.w_compile_tf-aws.md | 15 - ...r_capture_mutable.test.w_compile_tf-aws.md | 5 +- ..._inflight_closure.test.w_compile_tf-aws.md | 5 +- ...t_class_modifiers.test.w_compile_tf-aws.md | 5 - ..._inflight_closure.test.w_compile_tf-aws.md | 11 +- ..._interace_handler.test.w_compile_tf-aws.md | 10 +- ...lass_without_init.test.w_compile_tf-aws.md | 9 +- ...re_as_super_param.test.w_compile_tf-aws.md | 3 - ...ht_closure_autoid.test.w_compile_tf-aws.md | 3 - ...preflight_closure.test.w_compile_tf-aws.md | 3 - .../inflight_concat.test.w_compile_tf-aws.md | 5 +- ...handler_singleton.test.w_compile_tf-aws.md | 19 +- .../inflight_init.test.w_compile_tf-aws.md | 19 +- ...calling_inflights.test.w_compile_tf-aws.md | 5 +- ...erit_stdlib_class.test.w_compile_tf-aws.md | 9 +- ...ce_class_inflight.test.w_compile_tf-aws.md | 7 +- ...e_class_preflight.test.w_compile_tf-aws.md | 5 +- ...ritance_interface.test.w_compile_tf-aws.md | 5 +- .../valid/interface.test.w_compile_tf-aws.md | 3 - .../valid/intrinsics.test.w_compile_tf-aws.md | 58 +- .../valid/issue_2889.test.w_compile_tf-aws.md | 13 +- .../valid/json.test.w_compile_tf-aws.md | 5 +- .../json_bucket.test.w_compile_tf-aws.md | 5 +- .../json_static.test.w_compile_tf-aws.md | 7 +- ...ing_interpolation.test.w_compile_tf-aws.md | 3 - ...ft_expr_with_this.test.w_compile_tf-aws.md | 3 - ...losure_collection.test.w_compile_tf-aws.md | 5 +- ..._object_issue6501.test.w_compile_tf-aws.md | 11 +- ...ift_parent_fields.test.w_compile_tf-aws.md | 3 - ...lift_redefinition.test.w_compile_tf-aws.md | 3 - ...t_shared_resource.test.w_compile_tf-aws.md | 9 +- .../valid/lift_this.test.w_compile_tf-aws.md | 7 +- .../lift_via_closure.test.w_compile_tf-aws.md | 5 +- ..._closure_explicit.test.w_compile_tf-aws.md | 5 +- .../lift_weird_order.test.w_compile_tf-aws.md | 3 - ...ft_with_phase_ind.test.w_compile_tf-aws.md | 7 +- .../map_entries.test.w_compile_tf-aws.md | 3 - ...t_container_types.test.w_compile_tf-aws.md | 5 +- ..._after_class_init.test.w_compile_tf-aws.md | 9 +- .../new_in_static.test.w_compile_tf-aws.md | 14 +- .../new_in_static_lib.w_compile_tf-aws.md | 3 +- .../valid/new_jsii.test.w_compile_tf-aws.md | 5 +- .../valid/nil.test.w_compile_tf-aws.md | 5 +- .../valid/on_lift.test.w_compile_tf-aws.md | 8 +- .../valid/optionals.test.w_compile_tf-aws.md | 5 +- .../parameters.test.w_compile_tf-aws.md | 3 - .../parameters.test.w_compile_tf-aws.md | 3 - ..._method_on_string.test.w_compile_tf-aws.md | 9 +- ...primitive_methods.test.w_compile_tf-aws.md | 3 - .../valid/print.test.w_compile_tf-aws.md | 5 +- .../reassignment.test.w_compile_tf-aws.md | 3 - .../valid/redis.test.w_compile_tf-aws.md | 11 +- .../valid/resource.test.w_compile_tf-aws.md | 11 +- ..._inflight_literal.test.w_compile_tf-aws.md | 5 +- ...ource_call_static.test.w_compile_tf-aws.md | 5 +- ...resource_captures.test.w_compile_tf-aws.md | 5 +- ..._captures_globals.test.w_compile_tf-aws.md | 9 +- .../valid/service.test.w_compile_tf-aws.md | 3 - .../valid/shadowing.test.w_compile_tf-aws.md | 5 +- .../sim_resource.test.w_compile_tf-aws.md | 9 +- ...tatements_before_super.w_compile_tf-aws.md | 3 +- .../statements_if.test.w_compile_tf-aws.md | 5 +- ...able_declarations.test.w_compile_tf-aws.md | 3 - .../static_members.test.w_compile_tf-aws.md | 5 +- .../std_containers.test.w_compile_tf-aws.md | 3 - .../valid/std_string.test.w_compile_tf-aws.md | 3 - .../valid/store.w_compile_tf-aws.md | 8 +- .../valid/stringify.test.w_compile_tf-aws.md | 3 - .../struct_from_json.test.w_compile_tf-aws.md | 33 +- .../valid/structs.test.w_compile_tf-aws.md | 5 +- .../valid/super_call.test.w_compile_tf-aws.md | 19 +- .../symbol_shadow.test.w_compile_tf-aws.md | 5 +- .../valid/table.test.w_compile_tf-aws.md | 5 +- .../test_bucket.test.w_compile_tf-aws.md | 5 +- ...est_without_bring.test.w_compile_tf-aws.md | 3 - .../valid/this.test.w_compile_tf-aws.md | 5 +- .../to_inflight.test.w_compile_tf-aws.md | 5 +- .../valid/try_catch.test.w_compile_tf-aws.md | 3 - .../unused_lift.test.w_compile_tf-aws.md | 5 +- ...side_init_closure.test.w_compile_tf-aws.md | 5 +- .../website_with_api.test.w_compile_tf-aws.md | 27 +- .../valid/while.test.w_compile_tf-aws.md | 3 - .../while_loop_await.test.w_compile_tf-aws.md | 5 +- 276 files changed, 416 insertions(+), 2757 deletions(-) delete mode 100644 examples/tests/valid/subdir2/inflight_class.w delete mode 100644 libs/wingc/src/jsify/snapshots/qualify_inflight_type_refrencing_preflight_instance.snap diff --git a/apps/wing/src/commands/pack.test.ts b/apps/wing/src/commands/pack.test.ts index d424bb258ba..3bc815e0143 100644 --- a/apps/wing/src/commands/pack.test.ts +++ b/apps/wing/src/commands/pack.test.ts @@ -200,7 +200,6 @@ describe("wing pack", () => { expect(mod).toBeDefined(); expect(Object.keys(mod).sort()).toMatchInlineSnapshot(` [ - "$preflightTypesMap", "FavoriteNumbers", "Store", "default", diff --git a/examples/tests/valid/inflight_class_capture_preflight_object.test.w b/examples/tests/valid/inflight_class_capture_preflight_object.test.w index e23242ddb45..1dfeaceedaf 100644 --- a/examples/tests/valid/inflight_class_capture_preflight_object.test.w +++ b/examples/tests/valid/inflight_class_capture_preflight_object.test.w @@ -1,54 +1,18 @@ -bring cloud; -bring "./subdir2" as subdir; +// https://github.com/winglang/wing/issues/2730 +// FAILING: -let b = new cloud.Bucket(); +// bring cloud; -inflight class Foo { - pub uploadToBucket(k: str, value: str) { - b.put(k, value); - assert(b.get(k) == value); - } +// let b = new cloud.Bucket(); +// let myConst = "bang bang"; - static pub fooStatic() { - b.put("a", "b"); - assert(b.list() == ["a"]); - } -} +// inflight class Foo { +// uploadToBucket(k: str, value: str) { +// b.put(k, value); +// } +// } -test "inflight class captures preflight resource" { - let f = new Foo(); - f.uploadToBucket("hello.txt", "world"); -} - -test "inflight class type captures preflight resource" { - Foo.fooStatic(); -} - - -let getFoo = inflight () => { - return new Foo(); -}; - -test "inflight class qualified without explicit reference" { - // Get instance of Foo without mentioning the type - let foo = getFoo(); - // Now Foo needs to be qualified correcly - foo.uploadToBucket("greetings.txt", "universe"); -} - -test "inflight class defined inflight captures preflight object" { - class Foo2 { - pub uploadToBucket() { - b.put("x", "y"); - assert(b.get("x") == "y"); - } - } - - let f = new Foo2(); - f.uploadToBucket(); -} - -test "bring inflight class from subdir" { - let x = new subdir.InflightClass(); - assert(x.method() == "What did you expect?"); -} +// test "inflight class captures preflight resource" { +// let f = new Foo(); +// f.uploadToBucket("hello.txt", "world"); +// } diff --git a/examples/tests/valid/subdir/bar.w b/examples/tests/valid/subdir/bar.w index ff24b6028a7..d71c7640c46 100644 --- a/examples/tests/valid/subdir/bar.w +++ b/examples/tests/valid/subdir/bar.w @@ -8,5 +8,3 @@ pub class Bar { return @dirname; } } - -pub inflight class InflightBar {} \ No newline at end of file diff --git a/examples/tests/valid/subdir2/inflight_class.w b/examples/tests/valid/subdir2/inflight_class.w deleted file mode 100644 index bdf37243fe0..00000000000 --- a/examples/tests/valid/subdir2/inflight_class.w +++ /dev/null @@ -1,5 +0,0 @@ -pub inflight class InflightClass { - pub method(): str { - return "What did you expect?"; - } -} \ No newline at end of file diff --git a/libs/wingc/src/dtsify/snapshots/declarations.snap b/libs/wingc/src/dtsify/snapshots/declarations.snap index 59471505957..98f93db09e3 100644 --- a/libs/wingc/src/dtsify/snapshots/declarations.snap +++ b/libs/wingc/src/dtsify/snapshots/declarations.snap @@ -105,9 +105,9 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -const $preflightTypesMap = {}; -Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.lib-1.cjs`, $preflightTypesMap)); -module.exports = { ...module.exports, $preflightTypesMap }; +module.exports = { + ...require("./preflight.lib-1.cjs"), +}; //# sourceMappingURL=preflight.cjs.map ``` @@ -125,7 +125,6 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; class InflightClass extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -156,8 +155,6 @@ class InflightClass extends $stdlib.std.Resource { }); } } -if ($preflightTypesMap[1]) { throw new Error("InflightClass is already in type map"); } -$preflightTypesMap[1] = InflightClass; class ParentClass extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -189,14 +186,12 @@ class ParentClass extends $stdlib.std.Resource { "bar": [ ], "$inflight_init": [ - [InflightClass, []], ], }); } static get _liftTypeMap() { return ({ "static_method": [ - [InflightClass, []], ], }); } @@ -230,7 +225,7 @@ class Child extends ParentClass { }); } } -module.exports = { $preflightTypesMap, InflightClass, ParentClass, Child }; +module.exports = { InflightClass, ParentClass, Child }; //# sourceMappingURL=preflight.lib-1.cjs.map ``` diff --git a/libs/wingc/src/dtsify/snapshots/optionals.snap b/libs/wingc/src/dtsify/snapshots/optionals.snap index f2ec550c899..deac88efa6f 100644 --- a/libs/wingc/src/dtsify/snapshots/optionals.snap +++ b/libs/wingc/src/dtsify/snapshots/optionals.snap @@ -46,9 +46,9 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -const $preflightTypesMap = {}; -Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.lib-1.cjs`, $preflightTypesMap)); -module.exports = { ...module.exports, $preflightTypesMap }; +module.exports = { + ...require("./preflight.lib-1.cjs"), +}; //# sourceMappingURL=preflight.cjs.map ``` @@ -66,7 +66,6 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; class ParentClass extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -97,7 +96,7 @@ class ParentClass extends $stdlib.std.Resource { }); } } -module.exports = { $preflightTypesMap, ParentClass }; +module.exports = { ParentClass }; //# sourceMappingURL=preflight.lib-1.cjs.map ``` diff --git a/libs/wingc/src/jsify.rs b/libs/wingc/src/jsify.rs index 93d8d35c89a..bba287f31a7 100644 --- a/libs/wingc/src/jsify.rs +++ b/libs/wingc/src/jsify.rs @@ -41,8 +41,8 @@ const PREFLIGHT_FILE_NAME: &str = "preflight.cjs"; const STDLIB: &str = "$stdlib"; const STDLIB_CORE: &str = formatcp!("{STDLIB}.core"); -const STDLIB_CORE_RESOURCE: &str = formatcp!("{STDLIB}.{WINGSDK_RESOURCE}"); -const STDLIB_CORE_AUTOID_RESOURCE: &str = formatcp!("{STDLIB}.{WINGSDK_AUTOID_RESOURCE}"); +const STDLIB_CORE_RESOURCE: &str = formatcp!("{}.{}", STDLIB, WINGSDK_RESOURCE); +const STDLIB_CORE_AUTOID_RESOURCE: &str = formatcp!("{}.{}", STDLIB, WINGSDK_AUTOID_RESOURCE); const STDLIB_MODULE: &str = WINGSDK_ASSEMBLY_NAME; const ENV_WING_IS_TEST: &str = "$wing_is_test"; @@ -59,9 +59,6 @@ const __DIRNAME: &str = "__dirname"; const SUPER_CLASS_INFLIGHT_INIT_NAME: &str = formatcp!("super_{CLASS_INFLIGHT_INIT_NAME}"); -const PREFLIGHT_TYPES_MAP: &str = "$helpers.nodeof(this).root.$preflightTypesMap"; -const MODULE_PREFLIGHT_TYPES_MAP: &str = "$preflightTypesMap"; - const SCOPE_PARAM: &str = "$scope"; pub struct JSifyContext<'a> { @@ -103,7 +100,7 @@ impl VisitorWithContext for JSifyContext<'_> { /// Preflight classes have two types of host binding methods: /// `Type` for binding static fields and methods to the host and /// `instance` for binding instance fields and methods to the host. -#[derive(PartialEq)] +#[derive(PartialEq, Eq)] enum BindMethod { Type, Instance, @@ -157,7 +154,11 @@ impl<'a> JSifier<'a> { }) { let scope_env = self.types.get_scope_env(&scope); let s = self.jsify_statement(&scope_env, statement, &mut jsify_context); // top level statements are always preflight - if matches!(statement.kind, StmtKind::Bring { .. }) { + if let StmtKind::Bring { + identifier: _, + source: _, + } = statement.kind + { imports.add_code(s); } else { js.add_code(s); @@ -192,23 +193,14 @@ impl<'a> JSifier<'a> { output.line(format!( "const {EXTERN_VAR} = {HELPERS_VAR}.createExternRequire({__DIRNAME});" )); + output.add_code(imports); if is_entrypoint { let mut root_class = CodeMaker::default(); root_class.open(format!("class {} extends {} {{", ROOT_CLASS, STDLIB_CORE_RESOURCE)); root_class.open(format!("{JS_CONSTRUCTOR}({SCOPE_PARAM}, $id) {{")); root_class.line(format!("super({SCOPE_PARAM}, $id);")); - root_class.line(format!("{PREFLIGHT_TYPES_MAP} = {{ }};")); - - // The root preflight types map - root_class.line(format!("let {MODULE_PREFLIGHT_TYPES_MAP} = {{}};")); - - root_class.add_code(imports); root_class.add_code(self.jsify_struct_schemas(source_path)); - - // A global map pointing to the root preflight types map - root_class.line(format!("{PREFLIGHT_TYPES_MAP} = {MODULE_PREFLIGHT_TYPES_MAP};")); - root_class.add_code(js); root_class.close("}"); root_class.close("}"); @@ -228,43 +220,35 @@ impl<'a> JSifier<'a> { let directory_children = self.source_file_graph.dependencies_of(source_path); let preflight_file_map = self.preflight_file_map.borrow(); - // supposing a directory has a file and a subdirectory in it, + // supposing a directory has two files and two subdirectories in it, // we generate code like this: // ``` - // let $preflightTypesMap = {}; - // Object.assign(module.exports, $helpers.bringJs("./preflight.inner-file1.js", $preflightTypesMap)); - // Object.assign(module.exports, { get inner_directory1() { $helpers.bringJs("./preflight.inner-directory1.js", $preflightTypesMap); } }); - // module.exports = { ...module.exports, $preflightTypesMap }; + // module.exports = { + // get inner_directory1() { return require("./preflight.inner-directory1.cjs") }, + // get inner_directory2() { return require("./preflight.inner-directory2.cjs") }, + // ...require("./preflight.inner-file1.cjs"), + // ...require("./preflight.inner-file2.cjs"), + // }; // ``` - - // This module's preflight type map - output.line(format!("const {MODULE_PREFLIGHT_TYPES_MAP} = {{}};")); - + output.open("module.exports = {"); for file in directory_children { let preflight_file_name = preflight_file_map.get(file).expect("no emitted JS file found"); if file.is_dir() { let directory_name = file.file_stem().unwrap(); output.line(format!( - "Object.assign(module.exports, {{ get {directory_name}() {{ return $helpers.bringJs(`${{__dirname}}/{preflight_file_name}`, {MODULE_PREFLIGHT_TYPES_MAP}); }} }});" + "get {directory_name}() {{ return require(\"./{preflight_file_name}\") }}," )); } else { - output.line(format!( - "Object.assign(module.exports, $helpers.bringJs(`${{__dirname}}/{preflight_file_name}`, {MODULE_PREFLIGHT_TYPES_MAP}));" - )); + output.line(format!("...require(\"./{preflight_file_name}\"),")); } } - output.line(format!( - "module.exports = {{ ...module.exports, {MODULE_PREFLIGHT_TYPES_MAP} }};" - )); + output.close("};"); } else { - // This module's preflight type map - output.line(format!("let {MODULE_PREFLIGHT_TYPES_MAP} = {{}};")); - output.add_code(imports); output.add_code(self.jsify_struct_schemas(source_path)); output.add_code(js); let exports = get_public_symbols(&scope); output.line(format!( - "module.exports = {{ {MODULE_PREFLIGHT_TYPES_MAP}, {} }};", + "module.exports = {{ {} }};", exports.iter().map(ToString::to_string).join(", ") )); } @@ -1182,7 +1166,10 @@ impl<'a> JSifier<'a> { code.line(format!("const {var_name} = {STDLIB}.{name};")) } BringSource::TrustedModule(name, module_dir) => { - code.append(self.jsify_bring_stmt(module_dir, &Some(identifier.as_ref().unwrap_or(name).clone()))); + let preflight_file_map = self.preflight_file_map.borrow(); + let preflight_file_name = preflight_file_map.get(module_dir).unwrap(); + let var_name = identifier.as_ref().unwrap_or(&name); + code.line(format!("const {var_name} = require(\"./{preflight_file_name}\");")) } BringSource::JsiiModule(name) => { // checked during type checking @@ -1190,10 +1177,25 @@ impl<'a> JSifier<'a> { code.line(format!("const {var_name} = require(\"{name}\");")) } BringSource::WingLibrary(_, module_dir) => { - code.append(self.jsify_bring_stmt(module_dir, identifier)); + // checked during type checking + let var_name = identifier.as_ref().expect("bring wing library requires an alias"); + let preflight_file_map = self.preflight_file_map.borrow(); + let preflight_file_name = preflight_file_map.get(module_dir).unwrap(); + code.line(format!("const {var_name} = require(\"./{preflight_file_name}\");")) + } + BringSource::WingFile(path) => { + // checked during type checking + let var_name = identifier.as_ref().expect("bring wing file requires an alias"); + let preflight_file_map = self.preflight_file_map.borrow(); + let preflight_file_name = preflight_file_map.get(path).unwrap(); + code.line(format!("const {var_name} = require(\"./{preflight_file_name}\");")) } - BringSource::Directory(path) | BringSource::WingFile(path) => { - code.append(self.jsify_bring_stmt(path, identifier)); + BringSource::Directory(path) => { + // checked during type checking + let preflight_file_map = self.preflight_file_map.borrow(); + let preflight_file_name = preflight_file_map.get(path).unwrap(); + let var_name = identifier.as_ref().expect("bring wing directory requires an alias"); + code.line(format!("const {var_name} = require(\"./{preflight_file_name}\");")) } }, StmtKind::SuperConstructor { arg_list } => { @@ -1496,18 +1498,6 @@ impl<'a> JSifier<'a> { code } - fn jsify_bring_stmt(&self, path: &Utf8Path, identifier: &Option) -> CodeMaker { - let mut code = CodeMaker::default(); - // checked during type checking - let var_name = identifier.as_ref().expect("bring wing module requires an alias"); - let preflight_file_map = self.preflight_file_map.borrow(); - let preflight_file_name = preflight_file_map.get(path).unwrap(); - code.line(format!( - "const {var_name} = $helpers.bringJs(`${{__dirname}}/{preflight_file_name}`, {MODULE_PREFLIGHT_TYPES_MAP});" - )); - code - } - fn jsify_enum(&self, name: &Symbol, values: &IndexMap>) -> CodeMaker { let mut code = CodeMaker::with_source(&name.span); let mut value_index = 0; @@ -1859,32 +1849,10 @@ impl<'a> JSifier<'a> { code.add_code(self.jsify_register_bind_method(class, class_type, BindMethod::Type, ctx)); code.close("}"); - - // Inflight classes might need to be lift-qualified (onLift), but their type name might not be necessarily available - // at the scope when they are qualified (it might even be shadowed by another type name). We store a reference to these - // class types in a global preflight types map indexed by the class's unique id. - if class.phase == Phase::Inflight { - code.line(format!( - "if ({MODULE_PREFLIGHT_TYPES_MAP}[{}]) {{ throw new Error(\"{} is already in type map\"); }}", - class_type.as_class().unwrap().uid, - class.name - )); - code.line(format!( - "{MODULE_PREFLIGHT_TYPES_MAP}[{}] = {};", - class_type.as_class().unwrap().uid, - class.name - )); - } - code }) } - pub fn class_singleton(&self, type_: TypeRef) -> String { - let c = type_.as_class().unwrap(); - format!("$helpers.preflightClassSingleton(this, {})", c.uid) - } - fn jsify_preflight_constructor(&self, class: &AstClass, ctx: &mut JSifyContext) -> CodeMaker { let mut code = new_code!( &class.name.span, @@ -2202,9 +2170,9 @@ impl<'a> JSifier<'a> { } } - for f in class.inflight_fields() { - let name = &f.name; - let is_static = f.is_static; + for m in class.inflight_fields() { + let name = &m.name; + let is_static = m.is_static; let filter = match bind_method_kind { BindMethod::Instance => !is_static, BindMethod::Type => is_static, @@ -2229,9 +2197,7 @@ impl<'a> JSifier<'a> { if bind_method_kind == BindMethod::Instance && class.parent.is_some() { // mergeLiftDeps is a helper method that combines the lift deps of the parent class with the // lift deps of this class - bind_method.open(format!( - "return {STDLIB_CORE}.mergeLiftDeps(super.{bind_method_name}, {{" - )); + bind_method.open(format!("return {STDLIB_CORE}.mergeLiftDeps(super._liftMap, {{")); } else { bind_method.open("return ({".to_string()); } diff --git a/libs/wingc/src/jsify/snapshots/access_methods_and_properties_on_collections.snap b/libs/wingc/src/jsify/snapshots/access_methods_and_properties_on_collections.snap index c396742c435..ebc433dcb62 100644 --- a/libs/wingc/src/jsify/snapshots/access_methods_and_properties_on_collections.snap +++ b/libs/wingc/src/jsify/snapshots/access_methods_and_properties_on_collections.snap @@ -51,9 +51,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/access_property_on_primitive.snap b/libs/wingc/src/jsify/snapshots/access_property_on_primitive.snap index d093b8b3e3f..b5771fcc0b9 100644 --- a/libs/wingc/src/jsify/snapshots/access_property_on_primitive.snap +++ b/libs/wingc/src/jsify/snapshots/access_property_on_primitive.snap @@ -48,9 +48,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/access_property_on_value_returned_from_collection.snap b/libs/wingc/src/jsify/snapshots/access_property_on_value_returned_from_collection.snap index 3a47440282e..fdce5f92022 100644 --- a/libs/wingc/src/jsify/snapshots/access_property_on_value_returned_from_collection.snap +++ b/libs/wingc/src/jsify/snapshots/access_property_on_value_returned_from_collection.snap @@ -48,9 +48,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/allow_type_def_before_super.snap b/libs/wingc/src/jsify/snapshots/allow_type_def_before_super.snap index afc28743af5..bd00d29aa47 100644 --- a/libs/wingc/src/jsify/snapshots/allow_type_def_before_super.snap +++ b/libs/wingc/src/jsify/snapshots/allow_type_def_before_super.snap @@ -77,9 +77,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, x) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/base_class_captures_inflight.snap b/libs/wingc/src/jsify/snapshots/base_class_captures_inflight.snap index ca2c6cc48fd..c996859fb2d 100644 --- a/libs/wingc/src/jsify/snapshots/base_class_captures_inflight.snap +++ b/libs/wingc/src/jsify/snapshots/base_class_captures_inflight.snap @@ -72,9 +72,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Base extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/base_class_captures_preflight.snap b/libs/wingc/src/jsify/snapshots/base_class_captures_preflight.snap index 53de74f2c34..989c402998a 100644 --- a/libs/wingc/src/jsify/snapshots/base_class_captures_preflight.snap +++ b/libs/wingc/src/jsify/snapshots/base_class_captures_preflight.snap @@ -66,9 +66,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Base extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/base_class_lift_indirect.snap b/libs/wingc/src/jsify/snapshots/base_class_lift_indirect.snap index 945f43e89f4..a1098a4325a 100644 --- a/libs/wingc/src/jsify/snapshots/base_class_lift_indirect.snap +++ b/libs/wingc/src/jsify/snapshots/base_class_lift_indirect.snap @@ -77,13 +77,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Base extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/base_class_with_fields_inflight.snap b/libs/wingc/src/jsify/snapshots/base_class_with_fields_inflight.snap index 188a438eafd..1bcabfc5528 100644 --- a/libs/wingc/src/jsify/snapshots/base_class_with_fields_inflight.snap +++ b/libs/wingc/src/jsify/snapshots/base_class_with_fields_inflight.snap @@ -81,9 +81,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Base extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/base_class_with_fields_preflight.snap b/libs/wingc/src/jsify/snapshots/base_class_with_fields_preflight.snap index e055ea9023c..c5faa235839 100644 --- a/libs/wingc/src/jsify/snapshots/base_class_with_fields_preflight.snap +++ b/libs/wingc/src/jsify/snapshots/base_class_with_fields_preflight.snap @@ -71,9 +71,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Base extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/base_class_with_lifted_field_object.snap b/libs/wingc/src/jsify/snapshots/base_class_with_lifted_field_object.snap index 70cc6660dad..e2a2891ef78 100644 --- a/libs/wingc/src/jsify/snapshots/base_class_with_lifted_field_object.snap +++ b/libs/wingc/src/jsify/snapshots/base_class_with_lifted_field_object.snap @@ -68,13 +68,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Base extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/base_class_with_lifted_fields.snap b/libs/wingc/src/jsify/snapshots/base_class_with_lifted_fields.snap index eef16a40a7e..7793850313b 100644 --- a/libs/wingc/src/jsify/snapshots/base_class_with_lifted_fields.snap +++ b/libs/wingc/src/jsify/snapshots/base_class_with_lifted_fields.snap @@ -71,9 +71,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Base extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/builtins.snap b/libs/wingc/src/jsify/snapshots/builtins.snap index c27f7a970b4..53008dfdff0 100644 --- a/libs/wingc/src/jsify/snapshots/builtins.snap +++ b/libs/wingc/src/jsify/snapshots/builtins.snap @@ -46,9 +46,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/call_static_inflight_from_static_inflight.snap b/libs/wingc/src/jsify/snapshots/call_static_inflight_from_static_inflight.snap index 74ed9c87f61..d131a1db629 100644 --- a/libs/wingc/src/jsify/snapshots/call_static_inflight_from_static_inflight.snap +++ b/libs/wingc/src/jsify/snapshots/call_static_inflight_from_static_inflight.snap @@ -65,9 +65,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -139,8 +136,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[2]) { throw new Error("B is already in type map"); } - $preflightTypesMap[2] = B; } } const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); diff --git a/libs/wingc/src/jsify/snapshots/calls_methods_on_preflight_object.snap b/libs/wingc/src/jsify/snapshots/calls_methods_on_preflight_object.snap index 4bf1644e044..e34ef9d6acd 100644 --- a/libs/wingc/src/jsify/snapshots/calls_methods_on_preflight_object.snap +++ b/libs/wingc/src/jsify/snapshots/calls_methods_on_preflight_object.snap @@ -48,13 +48,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/capture_from_inside_an_inflight_closure.snap b/libs/wingc/src/jsify/snapshots/capture_from_inside_an_inflight_closure.snap index f3d25d6bb08..09e9197b655 100644 --- a/libs/wingc/src/jsify/snapshots/capture_from_inside_an_inflight_closure.snap +++ b/libs/wingc/src/jsify/snapshots/capture_from_inside_an_inflight_closure.snap @@ -48,13 +48,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const util = $stdlib.util; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const util = $stdlib.util; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/capture_identifier_closure_from_preflight_scope.snap b/libs/wingc/src/jsify/snapshots/capture_identifier_closure_from_preflight_scope.snap index f699bc23896..855df068e77 100644 --- a/libs/wingc/src/jsify/snapshots/capture_identifier_closure_from_preflight_scope.snap +++ b/libs/wingc/src/jsify/snapshots/capture_identifier_closure_from_preflight_scope.snap @@ -67,9 +67,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope.snap b/libs/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope.snap index 79c6953004d..7fc9b80532b 100644 --- a/libs/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope.snap +++ b/libs/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope.snap @@ -47,9 +47,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_method_call.snap b/libs/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_method_call.snap index b2f07c217a5..13cc38e59bb 100644 --- a/libs/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_method_call.snap +++ b/libs/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_method_call.snap @@ -68,9 +68,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_nested_object.snap b/libs/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_nested_object.snap index 0ec257d3e11..b5fbf73536b 100644 --- a/libs/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_nested_object.snap +++ b/libs/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_nested_object.snap @@ -68,13 +68,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_property.snap b/libs/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_property.snap index 9a5ef810928..a758b92f8cc 100644 --- a/libs/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_property.snap +++ b/libs/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_property.snap @@ -47,9 +47,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/capture_in_keyword_args.snap b/libs/wingc/src/jsify/snapshots/capture_in_keyword_args.snap index 0d9c3a3923e..312283f1f43 100644 --- a/libs/wingc/src/jsify/snapshots/capture_in_keyword_args.snap +++ b/libs/wingc/src/jsify/snapshots/capture_in_keyword_args.snap @@ -49,13 +49,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const util = $stdlib.util; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const util = $stdlib.util; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -84,11 +81,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), ["waitUntil"]], [x, []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), []], [x, []], ], }); diff --git a/libs/wingc/src/jsify/snapshots/capture_object_with_this_in_name.snap b/libs/wingc/src/jsify/snapshots/capture_object_with_this_in_name.snap index af034f5f15a..e08d93d3d5f 100644 --- a/libs/wingc/src/jsify/snapshots/capture_object_with_this_in_name.snap +++ b/libs/wingc/src/jsify/snapshots/capture_object_with_this_in_name.snap @@ -45,13 +45,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/capture_token.snap b/libs/wingc/src/jsify/snapshots/capture_token.snap index b4e6974caca..7d280541b37 100644 --- a/libs/wingc/src/jsify/snapshots/capture_token.snap +++ b/libs/wingc/src/jsify/snapshots/capture_token.snap @@ -44,13 +44,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/capture_type_inflight_class_sibling_from_init.snap b/libs/wingc/src/jsify/snapshots/capture_type_inflight_class_sibling_from_init.snap index 0a05c2e625e..e33734b441e 100644 --- a/libs/wingc/src/jsify/snapshots/capture_type_inflight_class_sibling_from_init.snap +++ b/libs/wingc/src/jsify/snapshots/capture_type_inflight_class_sibling_from_init.snap @@ -71,9 +71,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/capture_type_inflight_class_sibling_from_method.snap b/libs/wingc/src/jsify/snapshots/capture_type_inflight_class_sibling_from_method.snap index 979744061a1..47fb417fa00 100644 --- a/libs/wingc/src/jsify/snapshots/capture_type_inflight_class_sibling_from_method.snap +++ b/libs/wingc/src/jsify/snapshots/capture_type_inflight_class_sibling_from_method.snap @@ -57,9 +57,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/capture_type_new_inflight_class_inner_no_capture.snap b/libs/wingc/src/jsify/snapshots/capture_type_new_inflight_class_inner_no_capture.snap index af7adb56121..b0d4cbe8f02 100644 --- a/libs/wingc/src/jsify/snapshots/capture_type_new_inflight_class_inner_no_capture.snap +++ b/libs/wingc/src/jsify/snapshots/capture_type_new_inflight_class_inner_no_capture.snap @@ -49,9 +49,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/capture_type_new_inflight_class_outer.snap b/libs/wingc/src/jsify/snapshots/capture_type_new_inflight_class_outer.snap index 291806a0b6a..8489eec5041 100644 --- a/libs/wingc/src/jsify/snapshots/capture_type_new_inflight_class_outer.snap +++ b/libs/wingc/src/jsify/snapshots/capture_type_new_inflight_class_outer.snap @@ -61,9 +61,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -92,8 +89,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("Foo is already in type map"); } - $preflightTypesMap[1] = Foo; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -121,10 +116,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [Foo, []], ], "$inflight_init": [ - [Foo, []], ], }); } diff --git a/libs/wingc/src/jsify/snapshots/capture_type_static_method.snap b/libs/wingc/src/jsify/snapshots/capture_type_static_method.snap index 3cfdfa00daa..b6277673600 100644 --- a/libs/wingc/src/jsify/snapshots/capture_type_static_method.snap +++ b/libs/wingc/src/jsify/snapshots/capture_type_static_method.snap @@ -68,9 +68,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/capture_type_static_method_inflight_class.snap b/libs/wingc/src/jsify/snapshots/capture_type_static_method_inflight_class.snap index 3a90eddef62..cd7cc8981dd 100644 --- a/libs/wingc/src/jsify/snapshots/capture_type_static_method_inflight_class.snap +++ b/libs/wingc/src/jsify/snapshots/capture_type_static_method_inflight_class.snap @@ -66,9 +66,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -103,8 +100,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("Foo is already in type map"); } - $preflightTypesMap[1] = Foo; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -132,10 +127,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [Foo, ["bar"]], ], "$inflight_init": [ - [Foo, []], ], }); } diff --git a/libs/wingc/src/jsify/snapshots/capture_var_from_method_inflight.snap b/libs/wingc/src/jsify/snapshots/capture_var_from_method_inflight.snap index 12e633ae877..9254bf82239 100644 --- a/libs/wingc/src/jsify/snapshots/capture_var_from_method_inflight.snap +++ b/libs/wingc/src/jsify/snapshots/capture_var_from_method_inflight.snap @@ -54,9 +54,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/closed_inflight_class_extends_outer_inflight_class.snap b/libs/wingc/src/jsify/snapshots/closed_inflight_class_extends_outer_inflight_class.snap index 163c019e172..ebda1fe8f15 100644 --- a/libs/wingc/src/jsify/snapshots/closed_inflight_class_extends_outer_inflight_class.snap +++ b/libs/wingc/src/jsify/snapshots/closed_inflight_class_extends_outer_inflight_class.snap @@ -64,9 +64,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Base extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -95,8 +92,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("Base is already in type map"); } - $preflightTypesMap[1] = Base; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -124,10 +119,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [Base, []], ], "$inflight_init": [ - [Base, []], ], }); } diff --git a/libs/wingc/src/jsify/snapshots/closure_field.snap b/libs/wingc/src/jsify/snapshots/closure_field.snap index cb2ea648ef7..22d34a6d686 100644 --- a/libs/wingc/src/jsify/snapshots/closure_field.snap +++ b/libs/wingc/src/jsify/snapshots/closure_field.snap @@ -106,13 +106,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyResource extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/entrypoint_this.snap b/libs/wingc/src/jsify/snapshots/entrypoint_this.snap index 5e03a620b84..b61f8369c14 100644 --- a/libs/wingc/src/jsify/snapshots/entrypoint_this.snap +++ b/libs/wingc/src/jsify/snapshots/entrypoint_this.snap @@ -23,9 +23,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; this; } } diff --git a/libs/wingc/src/jsify/snapshots/enum_value.snap b/libs/wingc/src/jsify/snapshots/enum_value.snap index 759fb0f233f..e48c24d9f1e 100644 --- a/libs/wingc/src/jsify/snapshots/enum_value.snap +++ b/libs/wingc/src/jsify/snapshots/enum_value.snap @@ -51,9 +51,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const MyEnum = (function (tmp) { tmp["B"] = "B"; @@ -89,11 +86,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [MyEnum, [].concat(["B"], ["C"])], [x, []], ], "$inflight_init": [ - [MyEnum, []], [x, []], ], }); diff --git a/libs/wingc/src/jsify/snapshots/free_inflight_obj_from_inflight.snap b/libs/wingc/src/jsify/snapshots/free_inflight_obj_from_inflight.snap index 9b476ad3879..5257f8a3c70 100644 --- a/libs/wingc/src/jsify/snapshots/free_inflight_obj_from_inflight.snap +++ b/libs/wingc/src/jsify/snapshots/free_inflight_obj_from_inflight.snap @@ -59,9 +59,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/free_preflight_object_from_preflight.snap b/libs/wingc/src/jsify/snapshots/free_preflight_object_from_preflight.snap index 24507645cfb..15ebf279878 100644 --- a/libs/wingc/src/jsify/snapshots/free_preflight_object_from_preflight.snap +++ b/libs/wingc/src/jsify/snapshots/free_preflight_object_from_preflight.snap @@ -42,9 +42,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/func_returns_func.snap b/libs/wingc/src/jsify/snapshots/func_returns_func.snap index 8bb3df26820..2b8e67d67c0 100644 --- a/libs/wingc/src/jsify/snapshots/func_returns_func.snap +++ b/libs/wingc/src/jsify/snapshots/func_returns_func.snap @@ -56,9 +56,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/identify_field.snap b/libs/wingc/src/jsify/snapshots/identify_field.snap index bb5fcb10c79..8cdc9ae7a00 100644 --- a/libs/wingc/src/jsify/snapshots/identify_field.snap +++ b/libs/wingc/src/jsify/snapshots/identify_field.snap @@ -48,13 +48,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/implicit_lift_inflight_init.snap b/libs/wingc/src/jsify/snapshots/implicit_lift_inflight_init.snap index 2df0dbd74bc..ede8b4806e1 100644 --- a/libs/wingc/src/jsify/snapshots/implicit_lift_inflight_init.snap +++ b/libs/wingc/src/jsify/snapshots/implicit_lift_inflight_init.snap @@ -66,13 +66,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/indirect_capture.snap b/libs/wingc/src/jsify/snapshots/indirect_capture.snap index 8d67de04315..15a89bd9a55 100644 --- a/libs/wingc/src/jsify/snapshots/indirect_capture.snap +++ b/libs/wingc/src/jsify/snapshots/indirect_capture.snap @@ -81,13 +81,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Capture extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/inflight_class_extends_both_inside_inflight_closure.snap b/libs/wingc/src/jsify/snapshots/inflight_class_extends_both_inside_inflight_closure.snap index da1e9d8141b..c496a96fb04 100644 --- a/libs/wingc/src/jsify/snapshots/inflight_class_extends_both_inside_inflight_closure.snap +++ b/libs/wingc/src/jsify/snapshots/inflight_class_extends_both_inside_inflight_closure.snap @@ -50,9 +50,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/inflight_class_extends_inflight_class.snap b/libs/wingc/src/jsify/snapshots/inflight_class_extends_inflight_class.snap index 8a86b9e9704..681b87585d6 100644 --- a/libs/wingc/src/jsify/snapshots/inflight_class_extends_inflight_class.snap +++ b/libs/wingc/src/jsify/snapshots/inflight_class_extends_inflight_class.snap @@ -50,9 +50,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -81,8 +78,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("A is already in type map"); } - $preflightTypesMap[1] = A; class B extends A { constructor($scope, $id, ) { super($scope, $id); @@ -112,8 +107,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[2]) { throw new Error("B is already in type map"); } - $preflightTypesMap[2] = B; } } const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); diff --git a/libs/wingc/src/jsify/snapshots/inflight_constructor.snap b/libs/wingc/src/jsify/snapshots/inflight_constructor.snap index 1e355d4b666..80faa3b1138 100644 --- a/libs/wingc/src/jsify/snapshots/inflight_constructor.snap +++ b/libs/wingc/src/jsify/snapshots/inflight_constructor.snap @@ -54,9 +54,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/inflight_field.snap b/libs/wingc/src/jsify/snapshots/inflight_field.snap index 44c9860c391..0cfde3b80c0 100644 --- a/libs/wingc/src/jsify/snapshots/inflight_field.snap +++ b/libs/wingc/src/jsify/snapshots/inflight_field.snap @@ -53,9 +53,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/inflight_field_from_inflight.snap b/libs/wingc/src/jsify/snapshots/inflight_field_from_inflight.snap index 168eb48e6e2..f300ef416e6 100644 --- a/libs/wingc/src/jsify/snapshots/inflight_field_from_inflight.snap +++ b/libs/wingc/src/jsify/snapshots/inflight_field_from_inflight.snap @@ -52,9 +52,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyType extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/inflight_field_from_inflight_class.snap b/libs/wingc/src/jsify/snapshots/inflight_field_from_inflight_class.snap index fd0b68dc5e0..04d361bfed3 100644 --- a/libs/wingc/src/jsify/snapshots/inflight_field_from_inflight_class.snap +++ b/libs/wingc/src/jsify/snapshots/inflight_field_from_inflight_class.snap @@ -51,9 +51,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyType extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -88,8 +85,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("MyType is already in type map"); } - $preflightTypesMap[1] = MyType; } } const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); diff --git a/libs/wingc/src/jsify/snapshots/inline_inflight_class.snap b/libs/wingc/src/jsify/snapshots/inline_inflight_class.snap index 40650349c5e..2a44a3b8b81 100644 --- a/libs/wingc/src/jsify/snapshots/inline_inflight_class.snap +++ b/libs/wingc/src/jsify/snapshots/inline_inflight_class.snap @@ -69,13 +69,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/json_object.snap b/libs/wingc/src/jsify/snapshots/json_object.snap index e95b6a0cd8f..62036dd7fef 100644 --- a/libs/wingc/src/jsify/snapshots/json_object.snap +++ b/libs/wingc/src/jsify/snapshots/json_object.snap @@ -48,9 +48,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -79,11 +76,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), ["stringify"]], [jsonObj1, []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), []], [jsonObj1, []], ], }); diff --git a/libs/wingc/src/jsify/snapshots/lift_binary_preflight_and_inflight_expression.snap b/libs/wingc/src/jsify/snapshots/lift_binary_preflight_and_inflight_expression.snap index 093f1c00f6a..b61054c3b05 100644 --- a/libs/wingc/src/jsify/snapshots/lift_binary_preflight_and_inflight_expression.snap +++ b/libs/wingc/src/jsify/snapshots/lift_binary_preflight_and_inflight_expression.snap @@ -49,9 +49,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/lift_binary_preflight_expression.snap b/libs/wingc/src/jsify/snapshots/lift_binary_preflight_expression.snap index d845e175d9f..229498fdb1d 100644 --- a/libs/wingc/src/jsify/snapshots/lift_binary_preflight_expression.snap +++ b/libs/wingc/src/jsify/snapshots/lift_binary_preflight_expression.snap @@ -48,9 +48,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/lift_element_from_collection_as_field.snap b/libs/wingc/src/jsify/snapshots/lift_element_from_collection_as_field.snap index a4f169e0d4f..c047a224ca7 100644 --- a/libs/wingc/src/jsify/snapshots/lift_element_from_collection_as_field.snap +++ b/libs/wingc/src/jsify/snapshots/lift_element_from_collection_as_field.snap @@ -49,13 +49,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/lift_element_from_collection_of_objects.snap b/libs/wingc/src/jsify/snapshots/lift_element_from_collection_of_objects.snap index 7be2754fb37..3cbfadf715d 100644 --- a/libs/wingc/src/jsify/snapshots/lift_element_from_collection_of_objects.snap +++ b/libs/wingc/src/jsify/snapshots/lift_element_from_collection_of_objects.snap @@ -46,13 +46,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/lift_inflight_closure.snap b/libs/wingc/src/jsify/snapshots/lift_inflight_closure.snap index 9d50a7be1d5..28b88a5ba27 100644 --- a/libs/wingc/src/jsify/snapshots/lift_inflight_closure.snap +++ b/libs/wingc/src/jsify/snapshots/lift_inflight_closure.snap @@ -68,9 +68,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/lift_inside_preflight_method.snap b/libs/wingc/src/jsify/snapshots/lift_inside_preflight_method.snap index e8d95f5729a..4e5080a5db6 100644 --- a/libs/wingc/src/jsify/snapshots/lift_inside_preflight_method.snap +++ b/libs/wingc/src/jsify/snapshots/lift_inside_preflight_method.snap @@ -70,13 +70,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/lift_self_reference.snap b/libs/wingc/src/jsify/snapshots/lift_self_reference.snap index a6390026b34..a7b5c6332a4 100644 --- a/libs/wingc/src/jsify/snapshots/lift_self_reference.snap +++ b/libs/wingc/src/jsify/snapshots/lift_self_reference.snap @@ -49,9 +49,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/lift_string.snap b/libs/wingc/src/jsify/snapshots/lift_string.snap index 6822e8fce9e..72b030f22ac 100644 --- a/libs/wingc/src/jsify/snapshots/lift_string.snap +++ b/libs/wingc/src/jsify/snapshots/lift_string.snap @@ -47,9 +47,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/lift_this.snap b/libs/wingc/src/jsify/snapshots/lift_this.snap index cf64779fc21..6ab8730b88c 100644 --- a/libs/wingc/src/jsify/snapshots/lift_this.snap +++ b/libs/wingc/src/jsify/snapshots/lift_this.snap @@ -85,9 +85,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/lift_var_with_this.snap b/libs/wingc/src/jsify/snapshots/lift_var_with_this.snap index e9e961e1cf7..1274cd10e3a 100644 --- a/libs/wingc/src/jsify/snapshots/lift_var_with_this.snap +++ b/libs/wingc/src/jsify/snapshots/lift_var_with_this.snap @@ -68,9 +68,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/lift_via_closure.snap b/libs/wingc/src/jsify/snapshots/lift_via_closure.snap index e022d28e821..c2031ed3b27 100644 --- a/libs/wingc/src/jsify/snapshots/lift_via_closure.snap +++ b/libs/wingc/src/jsify/snapshots/lift_via_closure.snap @@ -72,13 +72,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/lift_via_closure_class_explicit.snap b/libs/wingc/src/jsify/snapshots/lift_via_closure_class_explicit.snap index 8fbf308b920..460441dd0a4 100644 --- a/libs/wingc/src/jsify/snapshots/lift_via_closure_class_explicit.snap +++ b/libs/wingc/src/jsify/snapshots/lift_via_closure_class_explicit.snap @@ -87,13 +87,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyClosure extends $stdlib.std.Resource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/namespaced_static_from_inflight.snap b/libs/wingc/src/jsify/snapshots/namespaced_static_from_inflight.snap index 0d641dd4434..d7c67b36828 100644 --- a/libs/wingc/src/jsify/snapshots/namespaced_static_from_inflight.snap +++ b/libs/wingc/src/jsify/snapshots/namespaced_static_from_inflight.snap @@ -44,13 +44,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const util = $stdlib.util; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const util = $stdlib.util; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -78,10 +75,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), ["tryEnv"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), []], ], }); } diff --git a/libs/wingc/src/jsify/snapshots/nested_inflight_after_preflight_operation.snap b/libs/wingc/src/jsify/snapshots/nested_inflight_after_preflight_operation.snap index 88c3a32572e..2c771b0b1f7 100644 --- a/libs/wingc/src/jsify/snapshots/nested_inflight_after_preflight_operation.snap +++ b/libs/wingc/src/jsify/snapshots/nested_inflight_after_preflight_operation.snap @@ -71,13 +71,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class YourType extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/nested_preflight_operation.snap b/libs/wingc/src/jsify/snapshots/nested_preflight_operation.snap index 016fb850a22..91257bfd431 100644 --- a/libs/wingc/src/jsify/snapshots/nested_preflight_operation.snap +++ b/libs/wingc/src/jsify/snapshots/nested_preflight_operation.snap @@ -89,13 +89,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class YourType extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/new_inflight_object.snap b/libs/wingc/src/jsify/snapshots/new_inflight_object.snap index 9b3694cc392..4c0fcdbb3da 100644 --- a/libs/wingc/src/jsify/snapshots/new_inflight_object.snap +++ b/libs/wingc/src/jsify/snapshots/new_inflight_object.snap @@ -61,9 +61,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -92,8 +89,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("Foo is already in type map"); } - $preflightTypesMap[1] = Foo; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -121,10 +116,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [Foo, []], ], "$inflight_init": [ - [Foo, []], ], }); } diff --git a/libs/wingc/src/jsify/snapshots/no_capture_inside_methods.snap b/libs/wingc/src/jsify/snapshots/no_capture_inside_methods.snap index e61472625e7..c053dcae157 100644 --- a/libs/wingc/src/jsify/snapshots/no_capture_inside_methods.snap +++ b/libs/wingc/src/jsify/snapshots/no_capture_inside_methods.snap @@ -52,9 +52,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/no_capture_of_identifier_from_inner_scope.snap b/libs/wingc/src/jsify/snapshots/no_capture_of_identifier_from_inner_scope.snap index 37f163fc6d2..d3992988748 100644 --- a/libs/wingc/src/jsify/snapshots/no_capture_of_identifier_from_inner_scope.snap +++ b/libs/wingc/src/jsify/snapshots/no_capture_of_identifier_from_inner_scope.snap @@ -52,9 +52,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/no_capture_of_identifier_from_same_scope.snap b/libs/wingc/src/jsify/snapshots/no_capture_of_identifier_from_same_scope.snap index 37d68e92fbf..8c96fb27ae5 100644 --- a/libs/wingc/src/jsify/snapshots/no_capture_of_identifier_from_same_scope.snap +++ b/libs/wingc/src/jsify/snapshots/no_capture_of_identifier_from_same_scope.snap @@ -48,9 +48,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/no_capture_shadow_inside_inner_scopes.snap b/libs/wingc/src/jsify/snapshots/no_capture_shadow_inside_inner_scopes.snap index e5a833fbf3d..54db26e1554 100644 --- a/libs/wingc/src/jsify/snapshots/no_capture_shadow_inside_inner_scopes.snap +++ b/libs/wingc/src/jsify/snapshots/no_capture_shadow_inside_inner_scopes.snap @@ -60,9 +60,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/no_lift_shadow_inside_inner_scopes.snap b/libs/wingc/src/jsify/snapshots/no_lift_shadow_inside_inner_scopes.snap index 8cf87f1c99b..5b6c9f12da8 100644 --- a/libs/wingc/src/jsify/snapshots/no_lift_shadow_inside_inner_scopes.snap +++ b/libs/wingc/src/jsify/snapshots/no_lift_shadow_inside_inner_scopes.snap @@ -58,9 +58,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/preflight_class_extends_preflight_class.snap b/libs/wingc/src/jsify/snapshots/preflight_class_extends_preflight_class.snap index 6f8b36e738e..f8df6a1e343 100644 --- a/libs/wingc/src/jsify/snapshots/preflight_class_extends_preflight_class.snap +++ b/libs/wingc/src/jsify/snapshots/preflight_class_extends_preflight_class.snap @@ -55,9 +55,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Base extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/preflight_collection.snap b/libs/wingc/src/jsify/snapshots/preflight_collection.snap index 3323d0b5213..a2e0f01dcee 100644 --- a/libs/wingc/src/jsify/snapshots/preflight_collection.snap +++ b/libs/wingc/src/jsify/snapshots/preflight_collection.snap @@ -49,9 +49,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/preflight_collection_of_preflight_objects.snap b/libs/wingc/src/jsify/snapshots/preflight_collection_of_preflight_objects.snap index 3c7d184510c..ccbf4ba8352 100644 --- a/libs/wingc/src/jsify/snapshots/preflight_collection_of_preflight_objects.snap +++ b/libs/wingc/src/jsify/snapshots/preflight_collection_of_preflight_objects.snap @@ -50,13 +50,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/preflight_nested_object_with_operations.snap b/libs/wingc/src/jsify/snapshots/preflight_nested_object_with_operations.snap index 24b2d65c6cc..d1f4f50769d 100644 --- a/libs/wingc/src/jsify/snapshots/preflight_nested_object_with_operations.snap +++ b/libs/wingc/src/jsify/snapshots/preflight_nested_object_with_operations.snap @@ -68,13 +68,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/preflight_object.snap b/libs/wingc/src/jsify/snapshots/preflight_object.snap index a9bbc073db2..c7d6b9c02a2 100644 --- a/libs/wingc/src/jsify/snapshots/preflight_object.snap +++ b/libs/wingc/src/jsify/snapshots/preflight_object.snap @@ -72,9 +72,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/preflight_object_through_property.snap b/libs/wingc/src/jsify/snapshots/preflight_object_through_property.snap index 9408fa25143..73ae66c5d8a 100644 --- a/libs/wingc/src/jsify/snapshots/preflight_object_through_property.snap +++ b/libs/wingc/src/jsify/snapshots/preflight_object_through_property.snap @@ -69,13 +69,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyType extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/preflight_object_with_operations.snap b/libs/wingc/src/jsify/snapshots/preflight_object_with_operations.snap index ccfc374b9c7..3118c933228 100644 --- a/libs/wingc/src/jsify/snapshots/preflight_object_with_operations.snap +++ b/libs/wingc/src/jsify/snapshots/preflight_object_with_operations.snap @@ -47,13 +47,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/preflight_object_with_operations_multiple_methods.snap b/libs/wingc/src/jsify/snapshots/preflight_object_with_operations_multiple_methods.snap index 1151652abb0..30684d0011d 100644 --- a/libs/wingc/src/jsify/snapshots/preflight_object_with_operations_multiple_methods.snap +++ b/libs/wingc/src/jsify/snapshots/preflight_object_with_operations_multiple_methods.snap @@ -52,13 +52,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/preflight_value_field.snap b/libs/wingc/src/jsify/snapshots/preflight_value_field.snap index 506fe835563..9a150a8c71d 100644 --- a/libs/wingc/src/jsify/snapshots/preflight_value_field.snap +++ b/libs/wingc/src/jsify/snapshots/preflight_value_field.snap @@ -77,9 +77,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyType extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/qualify_inflight_type_refrencing_preflight_instance.snap b/libs/wingc/src/jsify/snapshots/qualify_inflight_type_refrencing_preflight_instance.snap deleted file mode 100644 index f35589d1325..00000000000 --- a/libs/wingc/src/jsify/snapshots/qualify_inflight_type_refrencing_preflight_instance.snap +++ /dev/null @@ -1,209 +0,0 @@ ---- -source: libs/wingc/src/jsify/tests.rs ---- -## Code - -```w - - class PreflightC { - pub inflight bar() {} - } - let pc = new PreflightC(); - - inflight class InflightC { - pub foo() { - pc.bar(); - } - } - - test "test" { - let ic = new InflightC(); - ic.foo(); - } - -``` - -## inflight.$Closure1-1.cjs - -```js -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ $InflightC }) { - class $Closure1 { - constructor({ }) { - const $obj = (...args) => this.handle(...args); - Object.setPrototypeOf($obj, this); - return $obj; - } - async handle() { - const ic = (await (async () => {const o = new $InflightC(); await o.$inflight_init?.(); return o; })()); - (await ic.foo()); - } - } - return $Closure1; -} -//# sourceMappingURL=inflight.$Closure1-1.cjs.map -``` - -## inflight.InflightC-1.cjs - -```js -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ $pc }) { - class InflightC { - async foo() { - (await $pc.bar()); - } - } - return InflightC; -} -//# sourceMappingURL=inflight.InflightC-1.cjs.map -``` - -## inflight.PreflightC-1.cjs - -```js -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ }) { - class PreflightC { - constructor({ }) { - } - async bar() { - } - } - return PreflightC; -} -//# sourceMappingURL=inflight.PreflightC-1.cjs.map -``` - -## preflight.cjs - -```js -"use strict"; -const $stdlib = require('@winglang/sdk'); -const $platforms = ((s) => !s ? [] : s.split(';'))(process.env.WING_PLATFORMS); -const $outdir = process.env.WING_SYNTH_DIR ?? "."; -const $wing_is_test = process.env.WING_IS_TEST === "true"; -const std = $stdlib.std; -const $helpers = $stdlib.helpers; -const $extern = $helpers.createExternRequire(__dirname); -class $Root extends $stdlib.std.Resource { - constructor($scope, $id) { - super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; - class PreflightC extends $stdlib.std.Resource { - constructor($scope, $id, ) { - super($scope, $id); - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.PreflightC-1.cjs")({ - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const PreflightCClient = ${PreflightC._toInflightType()}; - const client = new PreflightCClient({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "bar": [ - ], - "$inflight_init": [ - ], - }); - } - } - class InflightC extends $stdlib.std.Resource { - constructor($scope, $id, ) { - super($scope, $id); - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.InflightC-1.cjs")({ - $pc: ${$stdlib.core.liftObject(pc)}, - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const InflightCClient = ${InflightC._toInflightType()}; - const client = new InflightCClient({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "foo": [ - [pc, ["bar"]], - ], - "$inflight_init": [ - [pc, []], - ], - }); - } - } - if ($preflightTypesMap[2]) { throw new Error("InflightC is already in type map"); } - $preflightTypesMap[2] = InflightC; - class $Closure1 extends $stdlib.std.AutoIdResource { - _id = $stdlib.core.closureId(); - constructor($scope, $id, ) { - super($scope, $id); - $helpers.nodeof(this).hidden = true; - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.$Closure1-1.cjs")({ - $InflightC: ${$stdlib.core.liftObject(InflightC)}, - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const $Closure1Client = ${$Closure1._toInflightType()}; - const client = new $Closure1Client({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "handle": [ - [$helpers.preflightClassSingleton(this, 2), ["foo"]], - [InflightC, []], - ], - "$inflight_init": [ - [$helpers.preflightClassSingleton(this, 2), []], - [InflightC, []], - ], - }); - } - } - const pc = new PreflightC(this, "PreflightC"); - this.node.root.new("@winglang/sdk.std.Test", std.Test, this, "test:test", new $Closure1(this, "$Closure1")); - } -} -const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); -const $APP = $PlatformManager.createApp({ outdir: $outdir, name: "main", rootConstruct: $Root, isTestEnvironment: $wing_is_test, entrypointDir: process.env['WING_SOURCE_DIR'], rootId: process.env['WING_ROOT_ID'] }); -$APP.synth(); -//# sourceMappingURL=preflight.cjs.map -``` - diff --git a/libs/wingc/src/jsify/snapshots/read_primitive_value.snap b/libs/wingc/src/jsify/snapshots/read_primitive_value.snap index db2b0b6ac0f..774da98ff7f 100644 --- a/libs/wingc/src/jsify/snapshots/read_primitive_value.snap +++ b/libs/wingc/src/jsify/snapshots/read_primitive_value.snap @@ -48,9 +48,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/reassign_captured_variable.snap b/libs/wingc/src/jsify/snapshots/reassign_captured_variable.snap index 2cd0be9082c..cdab8211e67 100644 --- a/libs/wingc/src/jsify/snapshots/reassign_captured_variable.snap +++ b/libs/wingc/src/jsify/snapshots/reassign_captured_variable.snap @@ -57,9 +57,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/reassigned_captured_variable_preflight.snap b/libs/wingc/src/jsify/snapshots/reassigned_captured_variable_preflight.snap index 0d37b640455..bbde03ffe57 100644 --- a/libs/wingc/src/jsify/snapshots/reassigned_captured_variable_preflight.snap +++ b/libs/wingc/src/jsify/snapshots/reassigned_captured_variable_preflight.snap @@ -26,9 +26,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; let i = 10; (() => { i = 12; diff --git a/libs/wingc/src/jsify/snapshots/ref_std_macro.snap b/libs/wingc/src/jsify/snapshots/ref_std_macro.snap index 3156b19bcd9..d421e6a3c7d 100644 --- a/libs/wingc/src/jsify/snapshots/ref_std_macro.snap +++ b/libs/wingc/src/jsify/snapshots/ref_std_macro.snap @@ -48,9 +48,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/reference_from_static_inflight.snap b/libs/wingc/src/jsify/snapshots/reference_from_static_inflight.snap index 4d446e7d47b..b4e479c49bf 100644 --- a/libs/wingc/src/jsify/snapshots/reference_from_static_inflight.snap +++ b/libs/wingc/src/jsify/snapshots/reference_from_static_inflight.snap @@ -47,9 +47,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyType extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/reference_inflight_class.snap b/libs/wingc/src/jsify/snapshots/reference_inflight_class.snap index c4c96cd62bd..7037afed5fc 100644 --- a/libs/wingc/src/jsify/snapshots/reference_inflight_class.snap +++ b/libs/wingc/src/jsify/snapshots/reference_inflight_class.snap @@ -66,9 +66,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -103,8 +100,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("Foo is already in type map"); } - $preflightTypesMap[1] = Foo; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -132,10 +127,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [Foo, ["a"]], ], "$inflight_init": [ - [Foo, []], ], }); } diff --git a/libs/wingc/src/jsify/snapshots/reference_inflight_field.snap b/libs/wingc/src/jsify/snapshots/reference_inflight_field.snap index 6444a8083db..28ee4f47cc6 100644 --- a/libs/wingc/src/jsify/snapshots/reference_inflight_field.snap +++ b/libs/wingc/src/jsify/snapshots/reference_inflight_field.snap @@ -54,9 +54,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/reference_inflight_from_inflight.snap b/libs/wingc/src/jsify/snapshots/reference_inflight_from_inflight.snap index 0597623b6b5..6ddf585201a 100644 --- a/libs/wingc/src/jsify/snapshots/reference_inflight_from_inflight.snap +++ b/libs/wingc/src/jsify/snapshots/reference_inflight_from_inflight.snap @@ -78,9 +78,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -114,8 +111,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("Foo is already in type map"); } - $preflightTypesMap[1] = Foo; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -143,10 +138,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [Foo, []], ], "$inflight_init": [ - [Foo, []], ], }); } diff --git a/libs/wingc/src/jsify/snapshots/reference_lift_of_collection.snap b/libs/wingc/src/jsify/snapshots/reference_lift_of_collection.snap index b478fce8fab..4baa0e5b574 100644 --- a/libs/wingc/src/jsify/snapshots/reference_lift_of_collection.snap +++ b/libs/wingc/src/jsify/snapshots/reference_lift_of_collection.snap @@ -48,9 +48,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/reference_preflight_field.snap b/libs/wingc/src/jsify/snapshots/reference_preflight_field.snap index 328f3d3829f..6d418fe4b67 100644 --- a/libs/wingc/src/jsify/snapshots/reference_preflight_field.snap +++ b/libs/wingc/src/jsify/snapshots/reference_preflight_field.snap @@ -52,9 +52,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/reference_preflight_field_call_independent_method.snap b/libs/wingc/src/jsify/snapshots/reference_preflight_field_call_independent_method.snap index 69384186b30..17388473e70 100644 --- a/libs/wingc/src/jsify/snapshots/reference_preflight_field_call_independent_method.snap +++ b/libs/wingc/src/jsify/snapshots/reference_preflight_field_call_independent_method.snap @@ -52,9 +52,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/reference_preflight_fields.snap b/libs/wingc/src/jsify/snapshots/reference_preflight_fields.snap index 27863adcafe..cabd4783e02 100644 --- a/libs/wingc/src/jsify/snapshots/reference_preflight_fields.snap +++ b/libs/wingc/src/jsify/snapshots/reference_preflight_fields.snap @@ -65,13 +65,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyType extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/reference_preflight_free_variable_with_this_in_the_expression.snap b/libs/wingc/src/jsify/snapshots/reference_preflight_free_variable_with_this_in_the_expression.snap index 7630bff1ae1..f7b74ca97e8 100644 --- a/libs/wingc/src/jsify/snapshots/reference_preflight_free_variable_with_this_in_the_expression.snap +++ b/libs/wingc/src/jsify/snapshots/reference_preflight_free_variable_with_this_in_the_expression.snap @@ -52,13 +52,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/reference_preflight_object_from_static_inflight.snap b/libs/wingc/src/jsify/snapshots/reference_preflight_object_from_static_inflight.snap index efc8fc0eed4..bee06339319 100644 --- a/libs/wingc/src/jsify/snapshots/reference_preflight_object_from_static_inflight.snap +++ b/libs/wingc/src/jsify/snapshots/reference_preflight_object_from_static_inflight.snap @@ -46,13 +46,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyType extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/reference_static_inflight.snap b/libs/wingc/src/jsify/snapshots/reference_static_inflight.snap index 8b105fd7f38..39e5714deae 100644 --- a/libs/wingc/src/jsify/snapshots/reference_static_inflight.snap +++ b/libs/wingc/src/jsify/snapshots/reference_static_inflight.snap @@ -68,9 +68,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyType extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/reference_static_inflight_which_references_preflight_object.snap b/libs/wingc/src/jsify/snapshots/reference_static_inflight_which_references_preflight_object.snap index c79a04b67f9..5fe4ab94cc7 100644 --- a/libs/wingc/src/jsify/snapshots/reference_static_inflight_which_references_preflight_object.snap +++ b/libs/wingc/src/jsify/snapshots/reference_static_inflight_which_references_preflight_object.snap @@ -73,13 +73,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyType extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/static_external_inflight_class.snap b/libs/wingc/src/jsify/snapshots/static_external_inflight_class.snap index 322b97d5ff9..1478a64ae25 100644 --- a/libs/wingc/src/jsify/snapshots/static_external_inflight_class.snap +++ b/libs/wingc/src/jsify/snapshots/static_external_inflight_class.snap @@ -77,9 +77,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -114,8 +111,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("A is already in type map"); } - $preflightTypesMap[1] = A; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -143,10 +138,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [A, ["foo"]], ], "$inflight_init": [ - [A, []], ], }); } diff --git a/libs/wingc/src/jsify/snapshots/static_external_preflight_class.snap b/libs/wingc/src/jsify/snapshots/static_external_preflight_class.snap index 1fbad7370de..6bdecac309e 100644 --- a/libs/wingc/src/jsify/snapshots/static_external_preflight_class.snap +++ b/libs/wingc/src/jsify/snapshots/static_external_preflight_class.snap @@ -76,9 +76,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/static_inflight_operation.snap b/libs/wingc/src/jsify/snapshots/static_inflight_operation.snap index 562280f0c7d..a3afeeb210c 100644 --- a/libs/wingc/src/jsify/snapshots/static_inflight_operation.snap +++ b/libs/wingc/src/jsify/snapshots/static_inflight_operation.snap @@ -70,13 +70,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/static_local_inflight_class.snap b/libs/wingc/src/jsify/snapshots/static_local_inflight_class.snap index e93803cd00f..ddd7d0bbc12 100644 --- a/libs/wingc/src/jsify/snapshots/static_local_inflight_class.snap +++ b/libs/wingc/src/jsify/snapshots/static_local_inflight_class.snap @@ -68,9 +68,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/static_on_std_type.snap b/libs/wingc/src/jsify/snapshots/static_on_std_type.snap index a8ddfb7e07e..cddb49b66f0 100644 --- a/libs/wingc/src/jsify/snapshots/static_on_std_type.snap +++ b/libs/wingc/src/jsify/snapshots/static_on_std_type.snap @@ -48,9 +48,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -79,12 +76,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), ["values"]], - [$stdlib.core.toLiftableModuleType(std.String, "@winglang/sdk/std", "String"), ["fromJson"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), []], - [$stdlib.core.toLiftableModuleType(std.String, "@winglang/sdk/std", "String"), []], ], }); } diff --git a/libs/wingc/src/jsify/snapshots/transitive_reference.snap b/libs/wingc/src/jsify/snapshots/transitive_reference.snap index ae54a46416d..847626e2f23 100644 --- a/libs/wingc/src/jsify/snapshots/transitive_reference.snap +++ b/libs/wingc/src/jsify/snapshots/transitive_reference.snap @@ -88,13 +88,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyType extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/transitive_reference_via_inflight_class.snap b/libs/wingc/src/jsify/snapshots/transitive_reference_via_inflight_class.snap index c3e61474e94..4d646d3361c 100644 --- a/libs/wingc/src/jsify/snapshots/transitive_reference_via_inflight_class.snap +++ b/libs/wingc/src/jsify/snapshots/transitive_reference_via_inflight_class.snap @@ -71,13 +71,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyInflightClass extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -111,8 +108,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("MyInflightClass is already in type map"); } - $preflightTypesMap[1] = MyInflightClass; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -140,12 +135,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$helpers.preflightClassSingleton(this, 1), ["putInBucket"]], - [MyInflightClass, []], ], "$inflight_init": [ - [$helpers.preflightClassSingleton(this, 1), []], - [MyInflightClass, []], ], }); } diff --git a/libs/wingc/src/jsify/snapshots/transitive_reference_via_static.snap b/libs/wingc/src/jsify/snapshots/transitive_reference_via_static.snap index 1b0e1405a7e..6360ecad233 100644 --- a/libs/wingc/src/jsify/snapshots/transitive_reference_via_static.snap +++ b/libs/wingc/src/jsify/snapshots/transitive_reference_via_static.snap @@ -96,13 +96,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyType extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/two_identical_lifts.snap b/libs/wingc/src/jsify/snapshots/two_identical_lifts.snap index ae17e2d8048..bc7e393332e 100644 --- a/libs/wingc/src/jsify/snapshots/two_identical_lifts.snap +++ b/libs/wingc/src/jsify/snapshots/two_identical_lifts.snap @@ -53,13 +53,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/libs/wingc/src/jsify/snapshots/use_util_functions.snap b/libs/wingc/src/jsify/snapshots/use_util_functions.snap index 6df9d47b4ac..85f8f9563f2 100644 --- a/libs/wingc/src/jsify/snapshots/use_util_functions.snap +++ b/libs/wingc/src/jsify/snapshots/use_util_functions.snap @@ -43,13 +43,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const util = $stdlib.util; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const util = $stdlib.util; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -77,10 +74,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), ["env"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), []], ], }); } diff --git a/libs/wingc/src/jsify/snapshots/var_inflight_field_from_inflight.snap b/libs/wingc/src/jsify/snapshots/var_inflight_field_from_inflight.snap index 4b1282f2b4b..d0e74b4002d 100644 --- a/libs/wingc/src/jsify/snapshots/var_inflight_field_from_inflight.snap +++ b/libs/wingc/src/jsify/snapshots/var_inflight_field_from_inflight.snap @@ -54,9 +54,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyType extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/libs/wingc/src/jsify/snapshots/wait_util.snap b/libs/wingc/src/jsify/snapshots/wait_util.snap index baae474a327..e2f23baff21 100644 --- a/libs/wingc/src/jsify/snapshots/wait_util.snap +++ b/libs/wingc/src/jsify/snapshots/wait_util.snap @@ -50,13 +50,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const util = $stdlib.util; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const util = $stdlib.util; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -84,10 +81,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), ["waitUntil"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), []], ], }); } diff --git a/libs/wingc/src/jsify/tests.rs b/libs/wingc/src/jsify/tests.rs index 775bfe69365..a07511e90c7 100644 --- a/libs/wingc/src/jsify/tests.rs +++ b/libs/wingc/src/jsify/tests.rs @@ -43,29 +43,6 @@ fn free_inflight_obj_from_inflight() { ); } -#[test] -fn qualify_inflight_type_refrencing_preflight_instance() { - assert_compile_ok!( - r#" - class PreflightC { - pub inflight bar() {} - } - let pc = new PreflightC(); - - inflight class InflightC { - pub foo() { - pc.bar(); - } - } - - test "test" { - let ic = new InflightC(); - ic.foo(); - } - "# - ); -} - #[test] fn call_static_inflight_from_static_inflight() { assert_compile_ok!( diff --git a/libs/wingc/src/lifting.rs b/libs/wingc/src/lifting.rs index ab5f4ec4baf..3be3514185f 100644 --- a/libs/wingc/src/lifting.rs +++ b/libs/wingc/src/lifting.rs @@ -9,7 +9,6 @@ use crate::{ diagnostic::{report_diagnostic, Diagnostic}, jsify::{JSifier, JSifyContext}, type_check::{ - get_udt_definition_phase, lifts::{Liftable, Lifts}, resolve_user_defined_type, symbol_env::LookupResult, @@ -202,7 +201,7 @@ impl<'a> Visit<'a> for LiftVisitor<'a> { fn visit_expr(&mut self, node: &'a Expr) { CompilationContext::set(CompilationPhase::Lifting, &node.span); - self.with_expr(&node, |v| { + self.with_expr(node.id, |v| { let expr_phase = v.jsify.types.get_expr_phase(&node).unwrap(); let expr_type = v.jsify.types.get_expr_type(&node); @@ -245,9 +244,9 @@ impl<'a> Visit<'a> for LiftVisitor<'a> { Some((PropertyObject::Instance(prop_expr_id), property)) if node.id == prop_expr_id => Some(property), _ => { if expr_type.is_closure() { - // this is the case where we are lifting a "closure class" (a preflight class that has an inflight `handle` - // method is being called) the reason we might not have "property" set is because closure classes might be - // syntheticaly generated by the compiler from closures. + // this is the case where we are lifting a "closure class" (e.g. a class that has a "handle" + // method). The "property" here is implicitly `handle`, these are generally syntheticaly generated by the compiler + // from closures. Some(Symbol::global(CLOSURE_CLASS_HANDLE_METHOD)) } else { None @@ -275,26 +274,7 @@ impl<'a> Visit<'a> for LiftVisitor<'a> { return; } - // Before we continue lets dive into this (non-preflight) expression to see if we need to lift any parts of it visit::visit_expr(v, node); - - // Check if this is an inflight class defined preflight and if we need to qualify the lift with the current property - if expr_phase == Phase::Inflight { - if let Some(class) = expr_type.as_class() { - if class.phase == Phase::Inflight && class.defined_in_phase == Phase::Preflight { - if let Some((_, property)) = v.ctx.current_property() { - let m = v.ctx.current_method().map(|(m, _)| m).expect("a method"); - let mut lifts = v.lifts_stack.pop().unwrap(); - // Get preflight code that references the type of the class so we can qualify the lift, note we use a unique - // type alias here since we might not have the actual type name available in scope here. - let code = &v.jsify.class_singleton(expr_type); - lifts.lift(m, Some(v.jsify_symbol_to_op_array(&property)), code); - v.lifts_stack.push(lifts); - return; - } - } - } - } }); } @@ -313,11 +293,14 @@ impl<'a> Visit<'a> for LiftVisitor<'a> { } // Get the type of the udt - let env = self.ctx.current_env().expect("an env"); - let udt_type = - resolve_user_defined_type(node, env, self.ctx.current_stmt_idx()).unwrap_or(self.jsify.types.error()); - - // Since our target language is isn't statically typed, we don't need to capture interfaces + let udt_type = resolve_user_defined_type( + node, + self.ctx.current_env().expect("an env"), + self.ctx.current_stmt_idx(), + ) + .unwrap_or(self.jsify.types.error()); + + // Since our target languages is isn't statically typed, we don't need to capture interfaces if udt_type.as_interface().is_some() { visit::visit_user_defined_type(self, node); return; @@ -325,11 +308,25 @@ impl<'a> Visit<'a> for LiftVisitor<'a> { //--------------- // LIFT - if get_udt_definition_phase(node, env).expect("a phase") == Phase::Preflight { + if udt_type.is_preflight_class() { // jsify the expression so we can get the preflight code let code = self.jsify_udt(&node); let property = self.ctx.current_property(); + + // check that we can qualify the lift (e.g. determine which property is being accessed) + if property.is_none() { + report_diagnostic(Diagnostic { + message: format!( + "Cannot qualify access to a lifted type \"{udt_type}\" (see https://github.com/winglang/wing/issues/76 for more details)"), + span: Some(node.span.clone()), + annotations: vec![], + hints: vec![], + }); + + return; + } + let mut lifts = self.lifts_stack.pop().unwrap(); lifts.lift( self.ctx.current_method().map(|(m, _)| m).expect("a method"), diff --git a/libs/wingc/src/lsp/symbol_locator.rs b/libs/wingc/src/lsp/symbol_locator.rs index 7c6fa79acae..9bdbd0b0b20 100644 --- a/libs/wingc/src/lsp/symbol_locator.rs +++ b/libs/wingc/src/lsp/symbol_locator.rs @@ -302,7 +302,7 @@ impl<'a> Visit<'a> for SymbolLocator<'a> { return; } - self.ctx.push_expr(&node); + self.ctx.push_expr(node.id); match &node.kind { ExprKind::New(new_expr) => 'new_expr: { diff --git a/libs/wingc/src/type_check.rs b/libs/wingc/src/type_check.rs index 6825cb1c77a..ce3fe0891a3 100644 --- a/libs/wingc/src/type_check.rs +++ b/libs/wingc/src/type_check.rs @@ -329,20 +329,11 @@ pub struct Class { pub docs: Docs, pub lifts: Option, - // The phase in which this class was defined (this should be the same as the env.phase where the class name is defined) - pub defined_in_phase: Phase, - // Preflight classes are CDK Constructs which means they have a scope and id as their first arguments // this is natively supported by wing using the `as` `in` keywords. However theoretically it is possible // to have a construct which does not have these arguments, in which case we can't use the `as` `in` keywords // and instead the user will need to pass the relevant args to the class's init method. pub std_construct_args: bool, - - // Unique identifier for this class type, used to get access to the type's generated preflight code even when - // the type name isn't available in scope or is shadowed. - // Ideally we should use the FQN and unify the implementation of JSII imported classes and Wing classes, currently - // uid is used for Wing classes and is always 0 for JSII classes to avoid snapshot noise. - pub uid: usize, } impl Class { pub(crate) fn set_lifts(&mut self, lifts: Lifts) { @@ -354,8 +345,8 @@ impl Class { pub fn get_closure_method(&self) -> Option { self .methods(true) - .find(|(name, v)| name == CLOSURE_CLASS_HANDLE_METHOD && v.type_.is_inflight_function()) - .map(|(_, v)| v.type_) + .find(|(name, type_)| name == CLOSURE_CLASS_HANDLE_METHOD && type_.is_inflight_function()) + .map(|(_, t)| t) } } @@ -387,15 +378,15 @@ impl Display for Interface { } type ClassLikeIterator<'a> = - FilterMap, fn(::Item) -> Option<(String, VariableInfo)>>; + FilterMap, fn(::Item) -> Option<(String, TypeRef)>>; pub trait ClassLike: Display { fn get_env(&self) -> &SymbolEnv; fn methods(&self, with_ancestry: bool) -> ClassLikeIterator<'_> { - self.get_env().iter(with_ancestry).filter_map(|(s, sym_kind, ..)| { - if sym_kind.as_variable()?.type_.as_function_sig().is_some() { - Some((s, sym_kind.as_variable()?.clone())) + self.get_env().iter(with_ancestry).filter_map(|(s, t, ..)| { + if t.as_variable()?.type_.as_function_sig().is_some() { + Some((s, t.as_variable()?.type_)) } else { None } @@ -403,9 +394,9 @@ pub trait ClassLike: Display { } fn fields(&self, with_ancestry: bool) -> ClassLikeIterator<'_> { - self.get_env().iter(with_ancestry).filter_map(|(s, sym_kind, ..)| { - if sym_kind.as_variable()?.type_.as_function_sig().is_none() { - Some((s, sym_kind.as_variable()?.clone())) + self.get_env().iter(with_ancestry).filter_map(|(s, t, ..)| { + if t.as_variable()?.type_.as_function_sig().is_none() { + Some((s, t.as_variable()?.type_)) } else { None } @@ -647,14 +638,16 @@ impl Subtype for Type { // method type (aka "closure classes"). // First, check if there is exactly one inflight method in the interface - let mut inflight_methods = iface.methods(true).filter(|(_name, v)| v.type_.is_inflight_function()); + let mut inflight_methods = iface + .methods(true) + .filter(|(_name, type_)| type_.is_inflight_function()); let handler_method = inflight_methods.next(); if handler_method.is_none() || inflight_methods.next().is_some() { return false; } // Next, check that the method's name is "handle" - let (handler_method_name, handler_method_var) = handler_method.unwrap(); + let (handler_method_name, handler_method_type) = handler_method.unwrap(); if handler_method_name != CLOSURE_CLASS_HANDLE_METHOD { return false; } @@ -667,7 +660,7 @@ impl Subtype for Type { }; // Finally check if they're subtypes - res_handle_type.is_subtype_of(&handler_method_var.type_) + res_handle_type.is_subtype_of(&handler_method_type) } (Self::Class(res), Self::Function(_)) => { // To support flexible inflight closures, we say that any @@ -1092,13 +1085,12 @@ impl TypeRef { /// Returns whether type represents a closure (either a function or a closure class). pub fn is_closure(&self) -> bool { - self.as_function_sig().is_some() || self.is_closure_class() - } + if self.as_function_sig().is_some() { + return true; + } - /// Returns whether type represents a class representing an inflight closure. - pub fn is_closure_class(&self) -> bool { - if let Some(ref class) = self.as_class() { - return class.get_closure_method().is_some() && class.defined_in_phase == Phase::Preflight; + if let Some(ref class) = self.as_preflight_class() { + return class.get_closure_method().is_some(); } false } @@ -1228,7 +1220,7 @@ impl TypeRef { Type::MutArray(t) => t.is_serializable(), Type::Map(t) => t.is_serializable(), Type::MutMap(t) => t.is_serializable(), - Type::Struct(s) => s.fields(true).map(|(_, v)| v.type_).all(|t| t.is_serializable()), + Type::Struct(s) => s.fields(true).map(|(_, t)| t).all(|t| t.is_serializable()), Type::Enum(_) => true, // not serializable Type::Duration => false, @@ -1266,7 +1258,7 @@ impl TypeRef { Type::Map(v) => v.is_json_legal_value(), Type::Optional(v) => v.is_json_legal_value(), Type::Struct(ref s) => { - for t in s.fields(true).map(|(_, v)| v.type_) { + for (_, t) in s.fields(true) { if !t.is_json_legal_value() { return false; } @@ -1303,8 +1295,8 @@ impl TypeRef { match &**self { Type::Struct(s) => { // check all its fields are json compatible - for t in s.fields(true).map(|(_, v)| v.type_) { - if !t.has_json_representation() { + for (_, field) in s.fields(true) { + if !field.has_json_representation() { return false; } } @@ -1399,8 +1391,6 @@ pub struct Types { type_expressions: IndexMap, /// Append empty struct to end of arg list pub append_empty_struct_to_arglist: HashSet, - /// Class counter, used to generate unique ids for class types - pub class_counter: usize, } impl Types { @@ -1453,9 +1443,6 @@ impl Types { append_empty_struct_to_arglist: HashSet::new(), libraries: SymbolEnv::new(None, SymbolEnvKind::Scope, Phase::Preflight, 0), intrinsics: SymbolEnv::new(None, SymbolEnvKind::Scope, Phase::Independent, 0), - // 1 based to avoid conflict with imported JSII classes. This isn't strictly needed since brought JSII classes are never accessed - // through their unique ID, but still good to avoid confusion. - class_counter: 1, } } @@ -2314,14 +2301,14 @@ new cloud.Function(@inflight("./handler.ts"), lifts: { bucket: ["put"] }); self.spanned_error( exp, format!( - "Binary operator '+' cannot be applied to operands of type '{}' and '{}'; only ({}, {}) and ({}, {}) are supported", - ltype, - rtype, - self.types.number(), - self.types.number(), - self.types.string(), - self.types.string(), - ), + "Binary operator '+' cannot be applied to operands of type '{}' and '{}'; only ({}, {}) and ({}, {}) are supported", + ltype, + rtype, + self.types.number(), + self.types.number(), + self.types.string(), + self.types.string(), + ), ); } self.resolved_error() @@ -2512,8 +2499,7 @@ new cloud.Function(@inflight("./handler.ts"), lifts: { bucket: ["put"] }); .expect(&format!("Expected \"{}\" to be a struct type", struct_type)); // Verify that all expected fields are present and are the right type - for (name, v) in st.fields(true) { - let field_type = v.type_; + for (name, field_type) in st.fields(true) { match fields.get(name.as_str()) { Some(field_exp) => { let t = field_types.get(name.as_str()).unwrap(); @@ -2769,9 +2755,21 @@ new cloud.Function(@inflight("./handler.ts"), lifts: { bucket: ["put"] }); // Make sure this is a function signature type let func_sig = if let Some(func_sig) = func_type.as_deep_function_sig() { func_sig.clone() - } else if func_type.is_closure_class() { - let handle_type = func_type.as_class().unwrap().get_closure_method().unwrap(); - handle_type.as_function_sig().unwrap().clone() + } else if let Some(class) = func_type.as_preflight_class() { + // return the signature of the "handle" method + let lookup_res = class.get_method(&CLOSURE_CLASS_HANDLE_METHOD.into()); + let handle_type = if let Some(method) = lookup_res { + method.type_ + } else { + self.spanned_error(callee, "Expected a function or method"); + return self.resolved_error(); + }; + if let Some(sig_type) = handle_type.as_function_sig() { + sig_type.clone() + } else { + self.spanned_error(callee, "Expected a function or method"); + return self.resolved_error(); + } } else { self.spanned_error( callee, @@ -3064,7 +3062,7 @@ new cloud.Function(@inflight("./handler.ts"), lifts: { bucket: ["put"] }); pub fn all_optional_struct(t: TypeRef) -> bool { match &*t { - Type::Struct(s) => s.fields(true).all(|(_, v)| v.type_.is_option()), + Type::Struct(s) => s.fields(true).all(|(_, t)| t.is_option()), _ => false, } } @@ -4522,13 +4520,10 @@ new cloud.Function(@inflight("./handler.ts"), lifts: { bucket: ["put"] }); implements: impl_interfaces.clone(), is_abstract: false, phase: ast_class.phase, - defined_in_phase: env.phase, docs: stmt.doc.as_ref().map_or(Docs::default(), |s| Docs::with_summary(s)), std_construct_args: ast_class.phase == Phase::Preflight, lifts: None, - uid: self.types.class_counter, }; - self.types.class_counter += 1; let mut class_type = self.types.add_type(Type::Class(class_spec)); match env.define( &ast_class.name, @@ -4743,8 +4738,7 @@ new cloud.Function(@inflight("./handler.ts"), lifts: { bucket: ["put"] }); }; // Check all methods are implemented - for (method_name, v) in interface_type.methods(true) { - let method_type = v.type_; + for (method_name, method_type) in interface_type.methods(true) { if let Some(symbol) = &mut class_type .as_class_mut() .unwrap() @@ -5303,7 +5297,7 @@ new cloud.Function(@inflight("./handler.ts"), lifts: { bucket: ["put"] }); return; }; - // If the parent class is phase independent then its constructor name is just "new" regardless of + // If the parent class is phase independent than its constructor name is just "new" regardless of // whether we're inflight or not. let parent_init_name = if parent_class.as_class().unwrap().phase == Phase::Independent { CLASS_INIT_NAME @@ -5315,13 +5309,13 @@ new cloud.Function(@inflight("./handler.ts"), lifts: { bucket: ["put"] }); .as_class() .unwrap() .methods(false) - .find(|(name, ..)| name == parent_init_name) - .unwrap() + .filter(|(name, _type)| name == parent_init_name) + .collect_vec()[0] .1; self.type_check_arg_list_against_function_sig( &arg_list, - parent_initializer.type_.as_function_sig().unwrap(), + parent_initializer.as_function_sig().unwrap(), super_constructor_call, arg_list_types, ); @@ -5761,8 +5755,6 @@ new cloud.Function(@inflight("./handler.ts"), lifts: { bucket: ["put"] }); docs: c.docs.clone(), std_construct_args: c.std_construct_args, lifts: None, - defined_in_phase: env.phase, - uid: c.uid, }), Type::Interface(iface) => Type::Interface(Interface { name: iface.name.clone(), @@ -6289,7 +6281,7 @@ new cloud.Function(@inflight("./handler.ts"), lifts: { bucket: ["put"] }); if property.name == FROM_JSON || property.name == TRY_FROM_JSON { // we need to validate that only structs with all valid json fields can have a fromJson method for (name, field) in s.fields(true) { - if !field.type_.has_json_representation() { + if !field.has_json_representation() { self.spanned_error_with_var( property, format!( @@ -6990,19 +6982,6 @@ pub fn resolve_user_defined_type_ref<'a>( } } -pub fn get_udt_definition_phase(user_defined_type: &UserDefinedType, env: &SymbolEnv) -> Option { - let mut nested_name = vec![&user_defined_type.root]; - nested_name.extend(user_defined_type.fields.iter().collect_vec()); - - let lookup_result = env.lookup_nested(&nested_name, None); - - if let LookupResult::Found(_, lookup_info) = lookup_result { - Some(lookup_info.env.phase) - } else { - None - } -} - pub fn is_udt_struct_type(udt: &UserDefinedType, env: &SymbolEnv) -> bool { if let Ok(type_) = resolve_user_defined_type(udt, env, 0) { type_.as_struct().is_some() diff --git a/libs/wingc/src/type_check/jsii_importer.rs b/libs/wingc/src/type_check/jsii_importer.rs index de39f947dff..65c99014da2 100644 --- a/libs/wingc/src/type_check/jsii_importer.rs +++ b/libs/wingc/src/type_check/jsii_importer.rs @@ -732,14 +732,9 @@ impl<'a> JsiiImporter<'a> { implements: vec![], is_abstract: jsii_class.abstract_.unwrap_or(false), phase: class_phase, - defined_in_phase: Phase::Preflight, docs: Docs::from(&jsii_class.docs), std_construct_args: false, // Temporary value, will be updated once we parse the initializer args lifts: None, - - // uid is used to create unique names class types so we can access the correct type regardless of type name shadowing, - // this isn't relevant for imported types (that aren't code generated), so we can default to 0 - uid: 0, }; let mut new_type = self.wing_types.add_type(Type::Class(class_spec)); self.register_jsii_type(&jsii_class_fqn, &new_type_symbol, new_type); diff --git a/libs/wingc/src/type_check/lifts.rs b/libs/wingc/src/type_check/lifts.rs index 61c7413bc08..8606c5e2bdc 100644 --- a/libs/wingc/src/type_check/lifts.rs +++ b/libs/wingc/src/type_check/lifts.rs @@ -10,7 +10,7 @@ use super::{ExprId, CLASS_INFLIGHT_INIT_NAME}; #[derive(Debug)] pub struct Lifts { // TODO: make all these private and add accessors+helper logic - /// All the lifts. Map from method to a map from preflight code to lift qualifications. + /// All the lifts. Map from method to a map from inflight code to lift qualifications. pub lifts_qualifications: BTreeMap>, /// All the captures. The key is token the value is the preflight code. diff --git a/libs/wingc/src/visit_context.rs b/libs/wingc/src/visit_context.rs index f2850b9424e..5004ba58074 100644 --- a/libs/wingc/src/visit_context.rs +++ b/libs/wingc/src/visit_context.rs @@ -1,7 +1,7 @@ use itertools::Itertools; use crate::{ - ast::{Class, Expr, ExprId, FunctionSignature, Phase, Stmt, StmtKind, Symbol, UserDefinedType}, + ast::{Class, ExprId, FunctionSignature, Phase, Stmt, StmtKind, Symbol, UserDefinedType}, type_check::symbol_env::SymbolEnvRef, }; @@ -91,8 +91,8 @@ impl VisitContext { // -- - pub fn push_expr(&mut self, expr: &Expr) { - self.expression.push(expr.id); + pub fn push_expr(&mut self, expr: ExprId) { + self.expression.push(expr); } pub fn pop_expr(&mut self) { @@ -237,7 +237,7 @@ impl VisitContext { pub trait VisitorWithContext { fn ctx(&mut self) -> &mut VisitContext; - fn with_expr(&mut self, expr: &Expr, f: impl FnOnce(&mut Self)) { + fn with_expr(&mut self, expr: ExprId, f: impl FnOnce(&mut Self)) { self.ctx().push_expr(expr); f(self); self.ctx().pop_expr(); diff --git a/libs/wingsdk/src/core/lifting.ts b/libs/wingsdk/src/core/lifting.ts index 41d2bb7fad0..737f4cfd434 100644 --- a/libs/wingsdk/src/core/lifting.ts +++ b/libs/wingsdk/src/core/lifting.ts @@ -265,7 +265,10 @@ export function collectLifts( } else if (typeof obj === "object" && obj._liftMap !== undefined) { matrix = parseMatrix(obj._liftMap ?? {}); matrixCache.set(obj, matrix); - } else if (typeof obj === "function" && obj._liftTypeMap !== undefined) { + } else if ( + typeof obj === "function" && + typeof obj._liftTypeMap !== undefined + ) { matrix = parseMatrix(obj._liftTypeMap ?? {}); matrixCache.set(obj, matrix); } else { diff --git a/libs/wingsdk/src/helpers.ts b/libs/wingsdk/src/helpers.ts index a009e93796a..a54598218d8 100644 --- a/libs/wingsdk/src/helpers.ts +++ b/libs/wingsdk/src/helpers.ts @@ -3,7 +3,6 @@ import { notDeepStrictEqual } from "node:assert"; import * as path from "node:path"; import type { Construct } from "constructs"; -import type { Resource } from "./std"; import type { Node } from "./std/node"; // since we moved from node:18 to node:20 the deepStrictEqual doesn't work as expected. // https://github.com/winglang/wing/issues/4444 @@ -167,63 +166,3 @@ export function resolveDirname( ): string { return normalPath(path.resolve(outdir, relativeSourceDir)); } - -/** - * Helper function to `require` a compiled preflight wing file (js) into another compiled (js) wing file. - * We need this instead of simply calling `require` because in addition to returning the imported module's exports, - * we also need to update the current module's preflight types map with the brought module's preflight types map. - * @param moduleFile - the file to `require` - * @param outPreflightTypesObject - the current module's $preflightTypesMap - * @returns all symbols exported by the `moduleFile` except `$preflightTypesMap` - */ -export function bringJs( - moduleFile: string, - outPreflightTypesObject: any -): Object { - /* eslint-disable @typescript-eslint/no-require-imports */ - return Object.fromEntries( - Object.entries(require(moduleFile)).filter(([k, v]) => { - // If this is the preflight types array then update the input object and skip it - if (k === "$preflightTypesMap") { - // Verify no key collision (should never happen) - Object.entries(v).forEach(([key, value]) => { - const otherValue = outPreflightTypesObject[key]; - if (key in outPreflightTypesObject && otherValue !== value) { - throw new Error(`Key collision (${key} is both ${value.name} and ${otherValue.name}) in preflight types map`); - } - }); - Object.assign(outPreflightTypesObject, v); - return false; - } - return true; - }) - ); -} - -/** - * Helper function to get a singleton instance of a class defined in preflight. - * In practice this is used to get the preflight instance of **inflight** classes defined **preflight**. - * This instance is used for accessing the lift map of such classes. - * @param scope - a scope in the construct tree that'll hold the instance (a singleton within that tree). - * @param typeId - the unique id of the preflight class type we want. - * @returns the instance of the class. - */ -export function preflightClassSingleton( - scope: Construct, - typeId: number -): Resource { - const root: any = nodeof(scope).root; - const type: any = root.$preflightTypesMap[typeId]; - if (root.resourceSingletons === undefined) { - root.resourceSingletons = {}; - } - const instance = root.resourceSingletons[type]; - if (instance) { - return instance; - } - root.resourceSingletons[type] = new type( - scope, - `${type.name}_singleton_${typeId}` - ); - return root.resourceSingletons[type]; -} diff --git a/tools/hangar/__snapshots__/invalid.ts.snap b/tools/hangar/__snapshots__/invalid.ts.snap index e944ae5e824..6021af442d6 100644 --- a/tools/hangar/__snapshots__/invalid.ts.snap +++ b/tools/hangar/__snapshots__/invalid.ts.snap @@ -2613,6 +2613,13 @@ error: Cannot create preflight class "PreflightClass" in inflight phase | ^^^^^^^^^^^^^^^^^^^^ +error: Cannot qualify access to a lifted type "PreflightClass" (see https://github.com/winglang/wing/issues/76 for more details) + --> ../../../examples/tests/invalid/inflight_class_created_in_preflight.test.w:19:7 + | +19 | new PreflightClass(); + | ^^^^^^^^^^^^^^ + + Tests 1 failed (1) Snapshots 1 skipped @@ -4084,6 +4091,13 @@ exports[`resource_inflight.test.w 1`] = ` | ^^^^^^^^^^^^^^^^^^ +error: Cannot qualify access to a lifted type "Bucket" (see https://github.com/winglang/wing/issues/76 for more details) + --> ../../../examples/tests/invalid/resource_inflight.test.w:4:7 + | +4 | new cloud.Bucket(); // Should fail because we can't create resources inflight + | ^^^^^^^^^^^^ + + Tests 1 failed (1) Snapshots 1 skipped diff --git a/tools/hangar/__snapshots__/test_corpus/valid/anon_function.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/anon_function.test.w_compile_tf-aws.md index a0171da37a6..48f9f26410c 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/anon_function.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/anon_function.test.w_compile_tf-aws.md @@ -54,9 +54,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/api.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/api.test.w_compile_tf-aws.md index 8693e2fefec..a225949abbd 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/api.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/api.test.w_compile_tf-aws.md @@ -476,13 +476,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -511,11 +508,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), ["stringify"]], [counter, ["inc"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), []], [counter, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/api_cors_custom.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/api_cors_custom.test.w_compile_tf-aws.md index bc5e0bfed85..34cc0b087ff 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/api_cors_custom.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/api_cors_custom.test.w_compile_tf-aws.md @@ -332,16 +332,13 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const ex = $stdlib.ex; +const http = $stdlib.http; +const expect = $stdlib.expect; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const ex = $stdlib.ex; - const http = $stdlib.http; - const expect = $stdlib.expect; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -403,13 +400,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), [].concat(["equal"], ["nil"])], - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), ["get"]], [api.url, []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), []], - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), []], [api.url, []], ], }); @@ -445,15 +438,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), [].concat(["equal"], ["nil"])], - [$stdlib.core.toLiftableModuleType(http.HttpMethod, "@winglang/sdk/http", "HttpMethod"), ["OPTIONS"]], - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), ["fetch"]], [api.url, []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), []], - [$stdlib.core.toLiftableModuleType(http.HttpMethod, "@winglang/sdk/http", "HttpMethod"), []], - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), []], [api.url, []], ], }); @@ -489,15 +476,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), ["equal"]], - [$stdlib.core.toLiftableModuleType(http.HttpMethod, "@winglang/sdk/http", "HttpMethod"), ["OPTIONS"]], - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), ["fetch"]], [api.url, []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), []], - [$stdlib.core.toLiftableModuleType(http.HttpMethod, "@winglang/sdk/http", "HttpMethod"), []], - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), []], [api.url, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/api_cors_default.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/api_cors_default.test.w_compile_tf-aws.md index 3c077f31ee8..7a432fa81b5 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/api_cors_default.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/api_cors_default.test.w_compile_tf-aws.md @@ -307,16 +307,13 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const ex = $stdlib.ex; +const http = $stdlib.http; +const expect = $stdlib.expect; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const ex = $stdlib.ex; - const http = $stdlib.http; - const expect = $stdlib.expect; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -378,13 +375,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), [].concat(["equal"], ["nil"])], - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), ["get"]], [apiDefaultCors.url, []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), []], - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), []], [apiDefaultCors.url, []], ], }); @@ -420,15 +413,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), [].concat(["equal"], ["nil"])], - [$stdlib.core.toLiftableModuleType(http.HttpMethod, "@winglang/sdk/http", "HttpMethod"), ["OPTIONS"]], - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), ["fetch"]], [apiDefaultCors.url, []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), []], - [$stdlib.core.toLiftableModuleType(http.HttpMethod, "@winglang/sdk/http", "HttpMethod"), []], - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), []], [apiDefaultCors.url, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/api_valid_path.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/api_valid_path.test.w_compile_tf-aws.md index 1ff40e38af2..636daf6a931 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/api_valid_path.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/api_valid_path.test.w_compile_tf-aws.md @@ -550,14 +550,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const expect = $stdlib.expect; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const expect = $stdlib.expect; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/assert.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/assert.test.w_compile_tf-aws.md index 9c24a66a33b..affbcd93807 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/assert.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/assert.test.w_compile_tf-aws.md @@ -65,9 +65,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/asynchronous_model_implicit_await_in_functions.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/asynchronous_model_implicit_await_in_functions.test.w_compile_tf-aws.md index 64402b8eac2..a1abff069c0 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/asynchronous_model_implicit_await_in_functions.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/asynchronous_model_implicit_await_in_functions.test.w_compile_tf-aws.md @@ -269,13 +269,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/baz.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/baz.w_compile_tf-aws.md index 0bef77200bc..806f0755f05 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/baz.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/baz.w_compile_tf-aws.md @@ -21,7 +21,6 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; class Baz extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -53,7 +52,7 @@ class Baz extends $stdlib.std.Resource { }); } } -module.exports = { $preflightTypesMap, Baz }; +module.exports = { Baz }; //# sourceMappingURL=preflight.cjs.map ``` diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_alias.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_alias.test.w_compile_tf-aws.md index 2355f752634..91d1d890678 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_alias.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_alias.test.w_compile_tf-aws.md @@ -28,14 +28,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const stdFs = $stdlib.fs; +const stdFs2 = $stdlib.fs; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const stdFs = $stdlib.fs; - const stdFs2 = $stdlib.fs; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; $helpers.assert($helpers.eq((stdFs.Util.dirname("/")), "/"), "stdFs.dirname(\"/\") == \"/\""); $helpers.assert($helpers.eq((stdFs2.Util.dirname("/")), "/"), "stdFs2.dirname(\"/\") == \"/\""); } diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_awscdk.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_awscdk.test.w_compile_tf-aws.md index 76c18f32c64..0619d7e6677 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_awscdk.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_awscdk.test.w_compile_tf-aws.md @@ -42,13 +42,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cdk = require("aws-cdk-lib"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cdk = require("aws-cdk-lib"); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class CdkDockerImageFunction extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_cdk8s.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_cdk8s.test.w_compile_tf-aws.md index 43ef75b0daa..759bd050819 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_cdk8s.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_cdk8s.test.w_compile_tf-aws.md @@ -28,14 +28,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cdk8s = require("cdk8s"); +const kplus = require("cdk8s-plus-27"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cdk8s = require("cdk8s"); - const kplus = require("cdk8s-plus-27"); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const app = this.node.root.new("cdk8s.App", cdk8s.App, ); const chart = this.node.root.new("cdk8s.Chart", cdk8s.Chart, this, "Chart"); const deploy = ($scope => $scope.node.root.new("cdk8s-plus-27.Deployment", kplus.Deployment, $scope, "Deployment"))(chart); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_cdktf.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_cdktf.test.w_compile_tf-aws.md index 47db08390c9..60cc9c5b347 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_cdktf.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_cdktf.test.w_compile_tf-aws.md @@ -59,14 +59,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const aws = require("@cdktf/provider-aws"); +const cdktf = require("cdktf"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const aws = require("@cdktf/provider-aws"); - const cdktf = require("cdktf"); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_extend_non_entry.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_extend_non_entry.test.w_compile_tf-aws.md index 169b251befa..7d08220759d 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_extend_non_entry.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_extend_non_entry.test.w_compile_tf-aws.md @@ -43,13 +43,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const lib = require("./preflight.extendnonentrypoint-1.cjs"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const lib = $helpers.bringJs(`${__dirname}/preflight.extendnonentrypoint-1.cjs`, $preflightTypesMap); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const f = new lib.Foo(this, "Foo"); } } @@ -66,7 +63,6 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; const cdk8s = require("cdk8s"); class Foo extends (this?.node?.root?.typeForFqn("cdk8s.Chart") ?? cdk8s.Chart) { constructor($scope, $id, ) { @@ -97,7 +93,7 @@ class Foo extends (this?.node?.root?.typeForFqn("cdk8s.Chart") ?? cdk8s.Chart) { }); } } -module.exports = { $preflightTypesMap, Foo }; +module.exports = { Foo }; //# sourceMappingURL=preflight.extendnonentrypoint-1.cjs.map ``` diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_jsii.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_jsii.test.w_compile_tf-aws.md index e670a56f704..8ce43dccc57 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_jsii.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_jsii.test.w_compile_tf-aws.md @@ -64,15 +64,12 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const stuff = require("jsii-code-samples"); +const jsii_fixture = require("jsii-fixture"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const stuff = require("jsii-code-samples"); - const jsii_fixture = require("jsii-fixture"); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -101,11 +98,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(stuff.HelloWorld, "jsii-code-samples", "HelloWorld"), []], [greeting, []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(stuff.HelloWorld, "jsii-code-samples", "HelloWorld"), []], [greeting, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_local.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_local.test.w_compile_tf-aws.md index 731e6cfad7f..eaea16be38c 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_local.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_local.test.w_compile_tf-aws.md @@ -297,17 +297,14 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const file1 = require("./preflight.store-2.cjs"); +const file2 = require("./preflight.subfile-3.cjs"); +const file3 = require("./preflight.empty-1.cjs"); +const math = $stdlib.math; +const expect = $stdlib.expect; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const file1 = $helpers.bringJs(`${__dirname}/preflight.store-2.cjs`, $preflightTypesMap); - const file2 = $helpers.bringJs(`${__dirname}/preflight.subfile-3.cjs`, $preflightTypesMap); - const file3 = $helpers.bringJs(`${__dirname}/preflight.empty-1.cjs`, $preflightTypesMap); - const math = $stdlib.math; - const expect = $stdlib.expect; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -371,11 +368,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), ["equal"]], [$stdlib.core.toLiftableModuleType(file2.Q, "", "Q"), ["greet"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), []], [$stdlib.core.toLiftableModuleType(file2.Q, "", "Q"), []], ], }); @@ -464,8 +459,7 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; -module.exports = { $preflightTypesMap, }; +module.exports = { }; //# sourceMappingURL=preflight.empty-1.cjs.map ``` @@ -476,8 +470,7 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; -const file3 = $helpers.bringJs(`${__dirname}/preflight.empty-1.cjs`, $preflightTypesMap); +const file3 = require("./preflight.empty-1.cjs"); const math = $stdlib.math; const cloud = $stdlib.cloud; const Color = @@ -587,7 +580,7 @@ class Store extends $stdlib.std.Resource { }); } } -module.exports = { $preflightTypesMap, Util, Store, Color }; +module.exports = { Util, Store, Color }; //# sourceMappingURL=preflight.store-2.cjs.map ``` @@ -598,7 +591,6 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; const math = $stdlib.math; class Q extends $stdlib.std.Resource { constructor($scope, $id, ) { @@ -637,7 +629,7 @@ class Q extends $stdlib.std.Resource { }); } } -module.exports = { $preflightTypesMap, Q }; +module.exports = { Q }; //# sourceMappingURL=preflight.subfile-3.cjs.map ``` diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_local_dir.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_local_dir.test.w_compile_tf-aws.md index 2dd33865c8f..0161018121b 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_local_dir.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_local_dir.test.w_compile_tf-aws.md @@ -42,21 +42,6 @@ module.exports = function({ }) { //# sourceMappingURL=inflight.Foo-3.cjs.map ``` -## inflight.InflightClass-4.cjs -```cjs -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ }) { - class InflightClass { - async method() { - return "What did you expect?"; - } - } - return InflightClass; -} -//# sourceMappingURL=inflight.InflightClass-4.cjs.map -``` - ## inflight.Widget-1.cjs ```cjs "use strict"; @@ -99,14 +84,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const w = require("./preflight.widget-1.cjs"); +const subdir = require("./preflight.subdir2-5.cjs"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const w = $helpers.bringJs(`${__dirname}/preflight.widget-1.cjs`, $preflightTypesMap); - const subdir = $helpers.bringJs(`${__dirname}/preflight.subdir2-6.cjs`, $preflightTypesMap); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const widget1 = new w.Widget(this, "widget1"); $helpers.assert($helpers.eq((widget1.compute()), 42), "widget1.compute() == 42"); const foo = new subdir.Foo(this, "Foo"); @@ -131,8 +113,7 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; -const blah = $helpers.bringJs(`${__dirname}/preflight.inner-2.cjs`, $preflightTypesMap); +const blah = require("./preflight.inner-2.cjs"); const cloud = $stdlib.cloud; const util = $stdlib.util; class Foo extends $stdlib.std.Resource { @@ -169,7 +150,7 @@ class Foo extends $stdlib.std.Resource { }); } } -module.exports = { $preflightTypesMap, Foo }; +module.exports = { Foo }; //# sourceMappingURL=preflight.file1-3.cjs.map ``` @@ -180,7 +161,6 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; const util = $stdlib.util; class Bar extends $stdlib.std.Resource { constructor($scope, $id, ) { @@ -242,54 +222,10 @@ class Foo extends $stdlib.std.Resource { }); } } -module.exports = { $preflightTypesMap, Bar }; +module.exports = { Bar }; //# sourceMappingURL=preflight.file2-4.cjs.map ``` -## preflight.inflightclass-5.cjs -```cjs -"use strict"; -const $stdlib = require('@winglang/sdk'); -const std = $stdlib.std; -const $helpers = $stdlib.helpers; -const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; -class InflightClass extends $stdlib.std.Resource { - constructor($scope, $id, ) { - super($scope, $id); - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.InflightClass-4.cjs")({ - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const InflightClassClient = ${InflightClass._toInflightType()}; - const client = new InflightClassClient({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "method": [ - ], - "$inflight_init": [ - ], - }); - } -} -if ($preflightTypesMap[5]) { throw new Error("InflightClass is already in type map"); } -$preflightTypesMap[5] = InflightClass; -module.exports = { $preflightTypesMap, InflightClass }; -//# sourceMappingURL=preflight.inflightclass-5.cjs.map -``` - ## preflight.inner-2.cjs ```cjs "use strict"; @@ -297,26 +233,25 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -const $preflightTypesMap = {}; -Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.widget-1.cjs`, $preflightTypesMap)); -module.exports = { ...module.exports, $preflightTypesMap }; +module.exports = { + ...require("./preflight.widget-1.cjs"), +}; //# sourceMappingURL=preflight.inner-2.cjs.map ``` -## preflight.subdir2-6.cjs +## preflight.subdir2-5.cjs ```cjs "use strict"; const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -const $preflightTypesMap = {}; -Object.assign(module.exports, { get inner() { return $helpers.bringJs(`${__dirname}/preflight.inner-2.cjs`, $preflightTypesMap); } }); -Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.inflightclass-5.cjs`, $preflightTypesMap)); -Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.file2-4.cjs`, $preflightTypesMap)); -Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.file1-3.cjs`, $preflightTypesMap)); -module.exports = { ...module.exports, $preflightTypesMap }; -//# sourceMappingURL=preflight.subdir2-6.cjs.map +module.exports = { + get inner() { return require("./preflight.inner-2.cjs") }, + ...require("./preflight.file2-4.cjs"), + ...require("./preflight.file1-3.cjs"), +}; +//# sourceMappingURL=preflight.subdir2-5.cjs.map ``` ## preflight.widget-1.cjs @@ -326,7 +261,6 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; class Widget extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -361,7 +295,7 @@ class Widget extends $stdlib.std.Resource { }); } } -module.exports = { $preflightTypesMap, Widget }; +module.exports = { Widget }; //# sourceMappingURL=preflight.widget-1.cjs.map ``` diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_local_normalization.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_local_normalization.test.w_compile_tf-aws.md index 18f71b210fe..4fc2a4d1afb 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_local_normalization.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_local_normalization.test.w_compile_tf-aws.md @@ -42,18 +42,6 @@ module.exports = function({ }) { //# sourceMappingURL=inflight.Foo-3.cjs.map ``` -## inflight.InflightBar-1.cjs -```cjs -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ }) { - class InflightBar { - } - return InflightBar; -} -//# sourceMappingURL=inflight.InflightBar-1.cjs.map -``` - ## main.tf.json ```json { @@ -79,7 +67,6 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; class Bar extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -114,37 +101,7 @@ class Bar extends $stdlib.std.Resource { }); } } -class InflightBar extends $stdlib.std.Resource { - constructor($scope, $id, ) { - super($scope, $id); - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.InflightBar-1.cjs")({ - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const InflightBarClient = ${InflightBar._toInflightType()}; - const client = new InflightBarClient({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "$inflight_init": [ - ], - }); - } -} -if ($preflightTypesMap[2]) { throw new Error("InflightBar is already in type map"); } -$preflightTypesMap[2] = InflightBar; -module.exports = { $preflightTypesMap, Bar, InflightBar }; +module.exports = { Bar }; //# sourceMappingURL=preflight.bar-1.cjs.map ``` @@ -155,7 +112,6 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; class Baz extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -187,7 +143,7 @@ class Baz extends $stdlib.std.Resource { }); } } -module.exports = { $preflightTypesMap, Baz }; +module.exports = { Baz }; //# sourceMappingURL=preflight.baz-2.cjs.map ``` @@ -201,15 +157,12 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const foo = require("./preflight.foo-3.cjs"); +const bar = require("./preflight.bar-1.cjs"); +const baz = require("./preflight.baz-2.cjs"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const foo = $helpers.bringJs(`${__dirname}/preflight.foo-3.cjs`, $preflightTypesMap); - const bar = $helpers.bringJs(`${__dirname}/preflight.bar-1.cjs`, $preflightTypesMap); - const baz = $helpers.bringJs(`${__dirname}/preflight.baz-2.cjs`, $preflightTypesMap); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; $helpers.assert($helpers.eq((foo.Foo.foo(this)), "foo"), "foo.Foo.foo() == \"foo\""); $helpers.assert($helpers.eq((foo.Foo.bar(this)), "bar"), "foo.Foo.bar() == \"bar\""); $helpers.assert($helpers.eq((foo.Foo.baz(this)), "baz"), "foo.Foo.baz() == \"baz\""); @@ -230,9 +183,8 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; -const bar = $helpers.bringJs(`${__dirname}/preflight.bar-1.cjs`, $preflightTypesMap); -const baz = $helpers.bringJs(`${__dirname}/preflight.baz-2.cjs`, $preflightTypesMap); +const bar = require("./preflight.bar-1.cjs"); +const baz = require("./preflight.baz-2.cjs"); class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -270,7 +222,7 @@ class Foo extends $stdlib.std.Resource { }); } } -module.exports = { $preflightTypesMap, Foo }; +module.exports = { Foo }; //# sourceMappingURL=preflight.foo-3.cjs.map ``` diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_projen.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_projen.test.w_compile_tf-aws.md index 7ccc2ee5a0c..85d3f6033f6 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_projen.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_projen.test.w_compile_tf-aws.md @@ -28,13 +28,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const projen = require("projen"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const projen = require("projen"); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; $helpers.assert($helpers.neq(projen.LogLevel.OFF, projen.LogLevel.VERBOSE), "projen.LogLevel.OFF != projen.LogLevel.VERBOSE"); } } diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_wing_library.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_wing_library.test.w_compile_tf-aws.md index 5e58a8ff2aa..39d1b1cbf04 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_wing_library.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_wing_library.test.w_compile_tf-aws.md @@ -107,15 +107,12 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const fixture = require("./preflight.testfixture-5.cjs"); +const testfixture = require("./preflight.testfixture-5.cjs"); +const testfixture2 = require("./preflight.testfixture-5.cjs"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const fixture = $helpers.bringJs(`${__dirname}/preflight.testfixture-5.cjs`, $preflightTypesMap); - const testfixture = $helpers.bringJs(`${__dirname}/preflight.testfixture-5.cjs`, $preflightTypesMap); - const testfixture2 = $helpers.bringJs(`${__dirname}/preflight.testfixture-5.cjs`, $preflightTypesMap); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -172,7 +169,6 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; const FavoriteNumbers = (function (tmp) { tmp["SEVEN"] = "SEVEN"; @@ -180,7 +176,7 @@ const FavoriteNumbers = return tmp; })({}) ; -module.exports = { $preflightTypesMap, FavoriteNumbers }; +module.exports = { FavoriteNumbers }; //# sourceMappingURL=preflight.enums-1.cjs.map ``` @@ -191,9 +187,8 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; const cloud = $stdlib.cloud; -const myutil = $helpers.bringJs(`${__dirname}/preflight.util-2.cjs`, $preflightTypesMap); +const myutil = require("./preflight.util-2.cjs"); class Store extends $stdlib.std.Resource { constructor($scope, $id, options) { super($scope, $id); @@ -247,7 +242,7 @@ class Store extends $stdlib.std.Resource { }); } } -module.exports = { $preflightTypesMap, Store }; +module.exports = { Store }; //# sourceMappingURL=preflight.store-3.cjs.map ``` @@ -258,9 +253,9 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -const $preflightTypesMap = {}; -Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.util-2.cjs`, $preflightTypesMap)); -module.exports = { ...module.exports, $preflightTypesMap }; +module.exports = { + ...require("./preflight.util-2.cjs"), +}; //# sourceMappingURL=preflight.subdir-4.cjs.map ``` @@ -271,11 +266,11 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -const $preflightTypesMap = {}; -Object.assign(module.exports, { get subdir() { return $helpers.bringJs(`${__dirname}/preflight.subdir-4.cjs`, $preflightTypesMap); } }); -Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.store-3.cjs`, $preflightTypesMap)); -Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.enums-1.cjs`, $preflightTypesMap)); -module.exports = { ...module.exports, $preflightTypesMap }; +module.exports = { + get subdir() { return require("./preflight.subdir-4.cjs") }, + ...require("./preflight.store-3.cjs"), + ...require("./preflight.enums-1.cjs"), +}; //# sourceMappingURL=preflight.testfixture-5.cjs.map ``` @@ -286,7 +281,6 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; class Util extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -323,7 +317,7 @@ class Util extends $stdlib.std.Resource { }); } } -module.exports = { $preflightTypesMap, Util }; +module.exports = { Util }; //# sourceMappingURL=preflight.util-2.cjs.map ``` diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bucket_keys.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bucket_keys.test.w_compile_tf-aws.md index e762d20f3e9..4b8c605b7a2 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bucket_keys.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bucket_keys.test.w_compile_tf-aws.md @@ -72,13 +72,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bypass_return.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bypass_return.test.w_compile_tf-aws.md index 03d5a647c20..ea4602f5b01 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bypass_return.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bypass_return.test.w_compile_tf-aws.md @@ -31,9 +31,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const simpleThrow = (() => { throw new Error("not implemented"); }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/call_static_of_myself.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/call_static_of_myself.test.w_compile_tf-aws.md index 84dbcc76d5b..4611883ee58 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/call_static_of_myself.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/call_static_of_myself.test.w_compile_tf-aws.md @@ -102,9 +102,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -170,10 +167,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "callThis": [ - [Bar, ["bar"]], ], "$inflight_init": [ - [Bar, []], ], }); } @@ -184,8 +179,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[2]) { throw new Error("Bar is already in type map"); } - $preflightTypesMap[2] = Bar; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -215,14 +208,10 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$helpers.preflightClassSingleton(this, 2), ["callThis"]], - [Bar, ["bar"]], [Foo, ["foo"]], [foo, ["callThis"]], ], "$inflight_init": [ - [$helpers.preflightClassSingleton(this, 2), []], - [Bar, []], [Foo, []], [foo, []], ], diff --git a/tools/hangar/__snapshots__/test_corpus/valid/calling_inflight_variants.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/calling_inflight_variants.test.w_compile_tf-aws.md index 00adcc28e4c..fd928e94383 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/calling_inflight_variants.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/calling_inflight_variants.test.w_compile_tf-aws.md @@ -113,9 +113,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_containers.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_containers.test.w_compile_tf-aws.md index dad39b8b93b..16cf7d4204f 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_containers.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_containers.test.w_compile_tf-aws.md @@ -56,13 +56,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_in_binary.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_in_binary.test.w_compile_tf-aws.md index ecf8ade3a00..73647713356 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_in_binary.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_in_binary.test.w_compile_tf-aws.md @@ -64,13 +64,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_mutables.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_mutables.test.w_compile_tf-aws.md index 1ec46a6ba0e..538560e462b 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_mutables.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_mutables.test.w_compile_tf-aws.md @@ -74,9 +74,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_primitives.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_primitives.test.w_compile_tf-aws.md index 0725bb48d7e..1b5082f1c70 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_primitives.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_primitives.test.w_compile_tf-aws.md @@ -168,13 +168,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_reassigable_class_field.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_reassigable_class_field.test.w_compile_tf-aws.md index 081361e3401..0e3e34f9f93 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_reassigable_class_field.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_reassigable_class_field.test.w_compile_tf-aws.md @@ -153,14 +153,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const util = $stdlib.util; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const util = $stdlib.util; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class KeyValueStore extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -301,12 +298,10 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), ["waitUntil"]], [counter, ["peek"]], [kv, [].concat(["set"], ["get"])], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), []], [counter, []], [kv, []], ], diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_reassignable.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_reassignable.test.w_compile_tf-aws.md index 8ce585923d3..17f9085dddc 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_reassignable.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_reassignable.test.w_compile_tf-aws.md @@ -68,13 +68,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_resource_and_data.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_resource_and_data.test.w_compile_tf-aws.md index 92ddc8fb9b6..3e4023e45ec 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_resource_and_data.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_resource_and_data.test.w_compile_tf-aws.md @@ -78,13 +78,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_resource_with_no_inflight.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_resource_with_no_inflight.test.w_compile_tf-aws.md index 69f6253c74e..54af4c008fb 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_resource_with_no_inflight.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_resource_with_no_inflight.test.w_compile_tf-aws.md @@ -90,13 +90,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_tokens.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_tokens.test.w_compile_tf-aws.md index c2e624d2b4e..55d284b2ce0 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_tokens.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_tokens.test.w_compile_tf-aws.md @@ -227,13 +227,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyResource extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/captures.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/captures.test.w_compile_tf-aws.md index e01268f629c..5e70bb4a547 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/captures.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/captures.test.w_compile_tf-aws.md @@ -648,13 +648,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/casting.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/casting.test.w_compile_tf-aws.md index fefdc50a3b4..d6739f9b1c8 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/casting.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/casting.test.w_compile_tf-aws.md @@ -47,15 +47,12 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const util = $stdlib.util; +const aws = require("@cdktf/provider-aws"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const util = $stdlib.util; - const aws = require("@cdktf/provider-aws"); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const b = this.node.root.new("@winglang/sdk.cloud.Bucket", cloud.Bucket, this, "Bucket"); if ($helpers.eq((util.Util.env("WING_TARGET")), "tf-aws")) { const s3Bucket = ($helpers.nodeof(b).findChild("Default")); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/class.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/class.test.w_compile_tf-aws.md index 16865355b48..222177a3393 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/class.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/class.test.w_compile_tf-aws.md @@ -586,13 +586,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class C1 extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -1214,8 +1211,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[20]) { throw new Error("A is already in type map"); } - $preflightTypesMap[20] = A; class B extends A { constructor($scope, $id, ) { super($scope, $id); @@ -1245,8 +1240,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[21]) { throw new Error("B is already in type map"); } - $preflightTypesMap[21] = B; class $Closure5 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -1274,12 +1267,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$helpers.preflightClassSingleton(this, 21), ["sound"]], - [B, []], ], "$inflight_init": [ - [$helpers.preflightClassSingleton(this, 21), []], - [B, []], ], }); } diff --git a/tools/hangar/__snapshots__/test_corpus/valid/closure_class.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/closure_class.test.w_compile_tf-aws.md index 62b11c93ac9..8527d14afd4 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/closure_class.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/closure_class.test.w_compile_tf-aws.md @@ -75,9 +75,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyClosure extends $stdlib.std.Resource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/construct-base.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/construct-base.test.w_compile_tf-aws.md index a2ad6b661c8..b303e7c3cea 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/construct-base.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/construct-base.test.w_compile_tf-aws.md @@ -54,15 +54,12 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const cx = require("constructs"); +const aws = require("@cdktf/provider-aws"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const cx = require("constructs"); - const aws = require("@cdktf/provider-aws"); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class WingResource extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/container_types.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/container_types.test.w_compile_tf-aws.md index a583447f5bf..bfc1c7752f2 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/container_types.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/container_types.test.w_compile_tf-aws.md @@ -62,13 +62,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const bucket1 = this.node.root.new("@winglang/sdk.cloud.Bucket", cloud.Bucket, this, "bucket1"); const bucket2 = this.node.root.new("@winglang/sdk.cloud.Bucket", cloud.Bucket, this, "bucket2"); const bucket3 = this.node.root.new("@winglang/sdk.cloud.Bucket", cloud.Bucket, this, "bucket3"); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/custom_obj_id.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/custom_obj_id.test.w_compile_tf-aws.md index fa553b1f8f1..09fd1622e94 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/custom_obj_id.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/custom_obj_id.test.w_compile_tf-aws.md @@ -45,9 +45,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/debug_env.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/debug_env.test.w_compile_tf-aws.md index 9f75a4cfd6e..3cc240d6983 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/debug_env.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/debug_env.test.w_compile_tf-aws.md @@ -42,13 +42,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/deep_equality.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/deep_equality.test.w_compile_tf-aws.md index fcb628d4bbd..3d139298a72 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/deep_equality.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/deep_equality.test.w_compile_tf-aws.md @@ -306,9 +306,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -503,10 +500,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), ["values"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), []], ], }); } diff --git a/tools/hangar/__snapshots__/test_corpus/valid/double_reference.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/double_reference.test.w_compile_tf-aws.md index 1796d7a91f5..f93187e3c3d 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/double_reference.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/double_reference.test.w_compile_tf-aws.md @@ -108,13 +108,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/doubler.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/doubler.test.w_compile_tf-aws.md index 1f81a187a68..0fabf02ee95 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/doubler.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/doubler.test.w_compile_tf-aws.md @@ -252,13 +252,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Doubler extends $stdlib.std.Resource { constructor($scope, $id, func) { super($scope, $id); @@ -359,13 +356,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), ["stringify"]], - [$stdlib.core.toLiftableModuleType(std.Number, "@winglang/sdk/std", "Number"), ["fromStr"]], [handler, ["handle"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), []], - [$stdlib.core.toLiftableModuleType(std.Number, "@winglang/sdk/std", "Number"), []], [handler, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/enums.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/enums.test.w_compile_tf-aws.md index 9d7aa868863..9dfb3b6b408 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/enums.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/enums.test.w_compile_tf-aws.md @@ -74,9 +74,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const SomeEnum = (function (tmp) { tmp["ONE"] = "ONE"; @@ -120,12 +117,10 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [SomeEnum, [].concat(["ONE"], ["TWO"])], [one, []], [two, []], ], "$inflight_init": [ - [SomeEnum, []], [one, []], [two, []], ], @@ -159,10 +154,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [SomeEnum, [].concat(["ONE"], ["TWO"], ["THREE"])], ], "$inflight_init": [ - [SomeEnum, []], ], }); } diff --git a/tools/hangar/__snapshots__/test_corpus/valid/explicit_lift_qualification.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/explicit_lift_qualification.test.w_compile_tf-aws.md index 82bfb8995d5..25ed7a932e0 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/explicit_lift_qualification.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/explicit_lift_qualification.test.w_compile_tf-aws.md @@ -213,13 +213,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/expressions_binary_operators.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/expressions_binary_operators.test.w_compile_tf-aws.md index 1e163ed75c5..5c8ac0336ed 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/expressions_binary_operators.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/expressions_binary_operators.test.w_compile_tf-aws.md @@ -31,9 +31,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const x = (-1); const y = (2 * x); const z = ((x + y) - 1); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/expressions_string_interpolation.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/expressions_string_interpolation.test.w_compile_tf-aws.md index 6fb16c92c8a..b320cc977b3 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/expressions_string_interpolation.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/expressions_string_interpolation.test.w_compile_tf-aws.md @@ -53,13 +53,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const expect = $stdlib.expect; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const expect = $stdlib.expect; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -88,11 +85,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), ["equal"]], [number, []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), []], [number, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/extend_non_entrypoint.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/extend_non_entrypoint.w_compile_tf-aws.md index 8bf44dfdc83..794ec04a576 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/extend_non_entrypoint.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/extend_non_entrypoint.w_compile_tf-aws.md @@ -22,7 +22,6 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; const cdk8s = require("cdk8s"); class Foo extends (this?.node?.root?.typeForFqn("cdk8s.Chart") ?? cdk8s.Chart) { constructor($scope, $id, ) { @@ -53,7 +52,7 @@ class Foo extends (this?.node?.root?.typeForFqn("cdk8s.Chart") ?? cdk8s.Chart) { }); } } -module.exports = { $preflightTypesMap, Foo }; +module.exports = { Foo }; //# sourceMappingURL=preflight.cjs.map ``` diff --git a/tools/hangar/__snapshots__/test_corpus/valid/extern_implementation.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/extern_implementation.test.w_compile_tf-aws.md index a8effb04aa1..8763ce21760 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/extern_implementation.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/extern_implementation.test.w_compile_tf-aws.md @@ -236,13 +236,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/file_counter.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/file_counter.test.w_compile_tf-aws.md index aceec6e2d13..a244a8ce90e 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/file_counter.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/file_counter.test.w_compile_tf-aws.md @@ -216,13 +216,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/for_loop.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/for_loop.test.w_compile_tf-aws.md index be92a25fbfe..49fed41ce7f 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/for_loop.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/for_loop.test.w_compile_tf-aws.md @@ -177,13 +177,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/forward_decl.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/forward_decl.test.w_compile_tf-aws.md index d176dedbad8..287a91f1761 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/forward_decl.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/forward_decl.test.w_compile_tf-aws.md @@ -45,9 +45,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class R extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/function_optional_arguments.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/function_optional_arguments.test.w_compile_tf-aws.md index 4cde6e758c9..2feba53142a 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/function_optional_arguments.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/function_optional_arguments.test.w_compile_tf-aws.md @@ -45,9 +45,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/function_returns_function.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/function_returns_function.test.w_compile_tf-aws.md index 02edb318a6f..0a2609770f3 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/function_returns_function.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/function_returns_function.test.w_compile_tf-aws.md @@ -56,13 +56,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/function_type.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/function_type.test.w_compile_tf-aws.md index d65d23f80fa..1047d0fd693 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/function_type.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/function_type.test.w_compile_tf-aws.md @@ -106,9 +106,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/function_variadic_arguments.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/function_variadic_arguments.test.w_compile_tf-aws.md index c8978d701ca..d0346334c75 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/function_variadic_arguments.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/function_variadic_arguments.test.w_compile_tf-aws.md @@ -91,13 +91,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, msg) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/hello.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/hello.test.w_compile_tf-aws.md index 88bcc5a917b..a61df751352 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/hello.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/hello.test.w_compile_tf-aws.md @@ -194,13 +194,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/identical_inflights.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/identical_inflights.test.w_compile_tf-aws.md index 34ffe393f1a..8f2cbcbb2ea 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/identical_inflights.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/identical_inflights.test.w_compile_tf-aws.md @@ -69,9 +69,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/impl_interface.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/impl_interface.test.w_compile_tf-aws.md index 1ba04695a5b..ee3ceb316ad 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/impl_interface.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/impl_interface.test.w_compile_tf-aws.md @@ -265,14 +265,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const jsii_fixture = require("jsii-fixture"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const jsii_fixture = require("jsii-fixture"); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -628,8 +625,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[11]) { throw new Error("ImplInflightIfaceInInflightClass is already in type map"); } - $preflightTypesMap[11] = ImplInflightIfaceInInflightClass; class ImplInflightIfaceInPreflightClass extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/implicit_std.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/implicit_std.test.w_compile_tf-aws.md index 22ee565a070..c2c93e1f0e7 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/implicit_std.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/implicit_std.test.w_compile_tf-aws.md @@ -31,9 +31,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const d = (std.Duration.fromMinutes(5)); const n = ((args) => { if (isNaN(args)) {throw new Error("unable to parse \"" + args + "\" as a number")}; return Number(args) })("12"); $helpers.assert($helpers.eq(d.seconds, (5 * 60)), "d.seconds == 5 * 60"); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/in_scope_construct.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/in_scope_construct.test.w_compile_tf-aws.md index 04c31a4940f..c0fa4e1a016 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/in_scope_construct.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/in_scope_construct.test.w_compile_tf-aws.md @@ -42,13 +42,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const c = require("constructs"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const c = require("constructs"); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyClass extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/indexing.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/indexing.test.w_compile_tf-aws.md index 36a734bcd31..63ac7687524 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/indexing.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/indexing.test.w_compile_tf-aws.md @@ -42,14 +42,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const expect = $stdlib.expect; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const expect = $stdlib.expect; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inference.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inference.test.w_compile_tf-aws.md index 5cbb1cd8f3d..d9c9ec036f8 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inference.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inference.test.w_compile_tf-aws.md @@ -253,13 +253,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight-subscribers.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight-subscribers.test.w_compile_tf-aws.md index ff2bdeff84e..c00ce72a039 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight-subscribers.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight-subscribers.test.w_compile_tf-aws.md @@ -322,13 +322,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_capture_static.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_capture_static.test.w_compile_tf-aws.md index 6acea4f262b..099441fc26c 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_capture_static.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_capture_static.test.w_compile_tf-aws.md @@ -154,13 +154,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const util = $stdlib.util; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const util = $stdlib.util; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Preflight extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -229,8 +226,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[2]) { throw new Error("OuterInflight is already in type map"); } - $preflightTypesMap[2] = OuterInflight; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -293,10 +288,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [OuterInflight, ["staticMethod"]], ], "$inflight_init": [ - [OuterInflight, []], ], }); } @@ -360,10 +353,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), ["tryEnv"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), []], ], }); } diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_as_struct_members.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_as_struct_members.test.w_compile_tf-aws.md index 22418a19e92..63eac774a41 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_as_struct_members.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_as_struct_members.test.w_compile_tf-aws.md @@ -87,9 +87,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -120,8 +117,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("Foo is already in type map"); } - $preflightTypesMap[1] = Foo; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -149,10 +144,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [Foo, []], ], "$inflight_init": [ - [Foo, []], ], }); } @@ -184,11 +177,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$helpers.preflightClassSingleton(this, 1), ["get"]], [getBar, ["handle"]], ], "$inflight_init": [ - [$helpers.preflightClassSingleton(this, 1), []], [getBar, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_const.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_const.test.w_compile_tf-aws.md index 3a91adb2ae5..fd1516e9e87 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_const.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_const.test.w_compile_tf-aws.md @@ -64,13 +64,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -104,8 +101,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("Foo is already in type map"); } - $preflightTypesMap[1] = Foo; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -134,13 +129,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$helpers.preflightClassSingleton(this, 1), ["getValue"]], - [Foo, []], [myConst, []], ], "$inflight_init": [ - [$helpers.preflightClassSingleton(this, 1), []], - [Foo, []], [myConst, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_preflight_object.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_preflight_object.test.w_compile_tf-aws.md index 07738803002..b11b224548b 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_preflight_object.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_preflight_object.test.w_compile_tf-aws.md @@ -1,226 +1,5 @@ # [inflight_class_capture_preflight_object.test.w](../../../../../examples/tests/valid/inflight_class_capture_preflight_object.test.w) | compile | tf-aws -## inflight.$Closure1-5.cjs -```cjs -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ $Foo }) { - class $Closure1 { - constructor({ }) { - const $obj = (...args) => this.handle(...args); - Object.setPrototypeOf($obj, this); - return $obj; - } - async handle() { - const f = (await (async () => {const o = new $Foo(); await o.$inflight_init?.(); return o; })()); - (await f.uploadToBucket("hello.txt", "world")); - } - } - return $Closure1; -} -//# sourceMappingURL=inflight.$Closure1-5.cjs.map -``` - -## inflight.$Closure2-5.cjs -```cjs -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ $Foo }) { - class $Closure2 { - constructor({ }) { - const $obj = (...args) => this.handle(...args); - Object.setPrototypeOf($obj, this); - return $obj; - } - async handle() { - (await $Foo.fooStatic()); - } - } - return $Closure2; -} -//# sourceMappingURL=inflight.$Closure2-5.cjs.map -``` - -## inflight.$Closure3-5.cjs -```cjs -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ $Foo }) { - class $Closure3 { - constructor({ }) { - const $obj = (...args) => this.handle(...args); - Object.setPrototypeOf($obj, this); - return $obj; - } - async handle() { - return (await (async () => {const o = new $Foo(); await o.$inflight_init?.(); return o; })()); - } - } - return $Closure3; -} -//# sourceMappingURL=inflight.$Closure3-5.cjs.map -``` - -## inflight.$Closure4-5.cjs -```cjs -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ $getFoo }) { - class $Closure4 { - constructor({ }) { - const $obj = (...args) => this.handle(...args); - Object.setPrototypeOf($obj, this); - return $obj; - } - async handle() { - const foo = (await $getFoo()); - (await foo.uploadToBucket("greetings.txt", "universe")); - } - } - return $Closure4; -} -//# sourceMappingURL=inflight.$Closure4-5.cjs.map -``` - -## inflight.$Closure5-5.cjs -```cjs -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ $b }) { - class $Closure5 { - constructor({ }) { - const $obj = (...args) => this.handle(...args); - Object.setPrototypeOf($obj, this); - return $obj; - } - async handle() { - class Foo2 { - async uploadToBucket() { - (await $b.put("x", "y")); - $helpers.assert($helpers.eq((await $b.get("x")), "y"), "b.get(\"x\") == \"y\""); - } - } - const f = (await (async () => {const o = new Foo2(); await o.$inflight_init?.(); return o; })()); - (await f.uploadToBucket()); - } - } - return $Closure5; -} -//# sourceMappingURL=inflight.$Closure5-5.cjs.map -``` - -## inflight.$Closure6-5.cjs -```cjs -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ $subdir_InflightClass }) { - class $Closure6 { - constructor({ }) { - const $obj = (...args) => this.handle(...args); - Object.setPrototypeOf($obj, this); - return $obj; - } - async handle() { - const x = (await (async () => {const o = new $subdir_InflightClass(); await o.$inflight_init?.(); return o; })()); - $helpers.assert($helpers.eq((await x.method()), "What did you expect?"), "x.method() == \"What did you expect?\""); - } - } - return $Closure6; -} -//# sourceMappingURL=inflight.$Closure6-5.cjs.map -``` - -## inflight.Bar-3.cjs -```cjs -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ }) { - class Bar { - constructor({ }) { - } - } - return Bar; -} -//# sourceMappingURL=inflight.Bar-3.cjs.map -``` - -## inflight.Foo-2.cjs -```cjs -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ }) { - class Foo { - constructor({ }) { - } - } - return Foo; -} -//# sourceMappingURL=inflight.Foo-2.cjs.map -``` - -## inflight.Foo-3.cjs -```cjs -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ }) { - class Foo { - constructor({ }) { - } - } - return Foo; -} -//# sourceMappingURL=inflight.Foo-3.cjs.map -``` - -## inflight.Foo-5.cjs -```cjs -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ $b }) { - class Foo { - async uploadToBucket(k, value) { - (await $b.put(k, value)); - $helpers.assert($helpers.eq((await $b.get(k)), value), "b.get(k) == value"); - } - static async fooStatic() { - (await $b.put("a", "b")); - $helpers.assert($helpers.eq((await $b.list()), ["a"]), "b.list() == [\"a\"]"); - } - } - return Foo; -} -//# sourceMappingURL=inflight.Foo-5.cjs.map -``` - -## inflight.InflightClass-4.cjs -```cjs -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ }) { - class InflightClass { - async method() { - return "What did you expect?"; - } - } - return InflightClass; -} -//# sourceMappingURL=inflight.InflightClass-4.cjs.map -``` - -## inflight.Widget-1.cjs -```cjs -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ }) { - class Widget { - constructor({ }) { - } - } - return Widget; -} -//# sourceMappingURL=inflight.Widget-1.cjs.map -``` - ## main.tf.json ```json { @@ -235,20 +14,6 @@ module.exports = function({ }) { "aws": [ {} ] - }, - "resource": { - "aws_s3_bucket": { - "Bucket": { - "//": { - "metadata": { - "path": "root/Default/Default/Bucket/Default", - "uniqueId": "Bucket" - } - }, - "bucket_prefix": "bucket-c88fdc5f-", - "force_destroy": false - } - } } } ``` @@ -266,276 +31,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const subdir = $helpers.bringJs(`${__dirname}/preflight.subdir2-6.cjs`, $preflightTypesMap); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; - class Foo extends $stdlib.std.Resource { - constructor($scope, $id, ) { - super($scope, $id); - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.Foo-5.cjs")({ - $b: ${$stdlib.core.liftObject(b)}, - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const FooClient = ${Foo._toInflightType()}; - const client = new FooClient({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "uploadToBucket": [ - [b, [].concat(["put"], ["get"])], - ], - "$inflight_init": [ - [b, []], - ], - }); - } - static get _liftTypeMap() { - return ({ - "fooStatic": [ - [b, [].concat(["put"], ["list"])], - ], - }); - } - } - if ($preflightTypesMap[6]) { throw new Error("Foo is already in type map"); } - $preflightTypesMap[6] = Foo; - class $Closure1 extends $stdlib.std.AutoIdResource { - _id = $stdlib.core.closureId(); - constructor($scope, $id, ) { - super($scope, $id); - $helpers.nodeof(this).hidden = true; - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.$Closure1-5.cjs")({ - $Foo: ${$stdlib.core.liftObject(Foo)}, - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const $Closure1Client = ${$Closure1._toInflightType()}; - const client = new $Closure1Client({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "handle": [ - [$helpers.preflightClassSingleton(this, 6), ["uploadToBucket"]], - [Foo, []], - ], - "$inflight_init": [ - [$helpers.preflightClassSingleton(this, 6), []], - [Foo, []], - ], - }); - } - } - class $Closure2 extends $stdlib.std.AutoIdResource { - _id = $stdlib.core.closureId(); - constructor($scope, $id, ) { - super($scope, $id); - $helpers.nodeof(this).hidden = true; - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.$Closure2-5.cjs")({ - $Foo: ${$stdlib.core.liftObject(Foo)}, - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const $Closure2Client = ${$Closure2._toInflightType()}; - const client = new $Closure2Client({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "handle": [ - [Foo, ["fooStatic"]], - ], - "$inflight_init": [ - [Foo, []], - ], - }); - } - } - class $Closure3 extends $stdlib.std.AutoIdResource { - _id = $stdlib.core.closureId(); - constructor($scope, $id, ) { - super($scope, $id); - $helpers.nodeof(this).hidden = true; - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.$Closure3-5.cjs")({ - $Foo: ${$stdlib.core.liftObject(Foo)}, - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const $Closure3Client = ${$Closure3._toInflightType()}; - const client = new $Closure3Client({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "handle": [ - [Foo, []], - ], - "$inflight_init": [ - [Foo, []], - ], - }); - } - } - class $Closure4 extends $stdlib.std.AutoIdResource { - _id = $stdlib.core.closureId(); - constructor($scope, $id, ) { - super($scope, $id); - $helpers.nodeof(this).hidden = true; - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.$Closure4-5.cjs")({ - $getFoo: ${$stdlib.core.liftObject(getFoo)}, - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const $Closure4Client = ${$Closure4._toInflightType()}; - const client = new $Closure4Client({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "handle": [ - [$helpers.preflightClassSingleton(this, 6), ["uploadToBucket"]], - [getFoo, ["handle"]], - ], - "$inflight_init": [ - [$helpers.preflightClassSingleton(this, 6), []], - [getFoo, []], - ], - }); - } - } - class $Closure5 extends $stdlib.std.AutoIdResource { - _id = $stdlib.core.closureId(); - constructor($scope, $id, ) { - super($scope, $id); - $helpers.nodeof(this).hidden = true; - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.$Closure5-5.cjs")({ - $b: ${$stdlib.core.liftObject(b)}, - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const $Closure5Client = ${$Closure5._toInflightType()}; - const client = new $Closure5Client({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "handle": [ - [b, [].concat(["put"], ["get"])], - ], - "$inflight_init": [ - [b, []], - ], - }); - } - } - class $Closure6 extends $stdlib.std.AutoIdResource { - _id = $stdlib.core.closureId(); - constructor($scope, $id, ) { - super($scope, $id); - $helpers.nodeof(this).hidden = true; - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.$Closure6-5.cjs")({ - $subdir_InflightClass: ${$stdlib.core.liftObject($stdlib.core.toLiftableModuleType(subdir.InflightClass, "", "InflightClass"))}, - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const $Closure6Client = ${$Closure6._toInflightType()}; - const client = new $Closure6Client({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "handle": [ - [$helpers.preflightClassSingleton(this, 5), ["method"]], - [$stdlib.core.toLiftableModuleType(subdir.InflightClass, "", "InflightClass"), []], - ], - "$inflight_init": [ - [$helpers.preflightClassSingleton(this, 5), []], - [$stdlib.core.toLiftableModuleType(subdir.InflightClass, "", "InflightClass"), []], - ], - }); - } - } - const b = this.node.root.new("@winglang/sdk.cloud.Bucket", cloud.Bucket, this, "Bucket"); - this.node.root.new("@winglang/sdk.std.Test", std.Test, this, "test:inflight class captures preflight resource", new $Closure1(this, "$Closure1")); - this.node.root.new("@winglang/sdk.std.Test", std.Test, this, "test:inflight class type captures preflight resource", new $Closure2(this, "$Closure2")); - const getFoo = new $Closure3(this, "$Closure3"); - this.node.root.new("@winglang/sdk.std.Test", std.Test, this, "test:inflight class qualified without explicit reference", new $Closure4(this, "$Closure4")); - this.node.root.new("@winglang/sdk.std.Test", std.Test, this, "test:inflight class defined inflight captures preflight object", new $Closure5(this, "$Closure5")); - this.node.root.new("@winglang/sdk.std.Test", std.Test, this, "test:bring inflight class from subdir", new $Closure6(this, "$Closure6")); } } const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); @@ -544,244 +39,3 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` -## preflight.file1-3.cjs -```cjs -"use strict"; -const $stdlib = require('@winglang/sdk'); -const std = $stdlib.std; -const $helpers = $stdlib.helpers; -const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; -const blah = $helpers.bringJs(`${__dirname}/preflight.inner-2.cjs`, $preflightTypesMap); -const cloud = $stdlib.cloud; -const util = $stdlib.util; -class Foo extends $stdlib.std.Resource { - constructor($scope, $id, ) { - super($scope, $id); - } - foo() { - return "foo"; - } - checkWidget(widget) { - return ((widget.compute()) + (blah.Widget.staticCompute(this))); - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.Foo-2.cjs")({ - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const FooClient = ${Foo._toInflightType()}; - const client = new FooClient({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "$inflight_init": [ - ], - }); - } -} -module.exports = { $preflightTypesMap, Foo }; -//# sourceMappingURL=preflight.file1-3.cjs.map -``` - -## preflight.file2-4.cjs -```cjs -"use strict"; -const $stdlib = require('@winglang/sdk'); -const std = $stdlib.std; -const $helpers = $stdlib.helpers; -const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; -const util = $stdlib.util; -class Bar extends $stdlib.std.Resource { - constructor($scope, $id, ) { - super($scope, $id); - } - bar() { - (util.Util.nanoid()); - return "bar"; - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.Bar-3.cjs")({ - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const BarClient = ${Bar._toInflightType()}; - const client = new BarClient({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "$inflight_init": [ - ], - }); - } -} -class Foo extends $stdlib.std.Resource { - constructor($scope, $id, ) { - super($scope, $id); - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.Foo-3.cjs")({ - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const FooClient = ${Foo._toInflightType()}; - const client = new FooClient({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "$inflight_init": [ - ], - }); - } -} -module.exports = { $preflightTypesMap, Bar }; -//# sourceMappingURL=preflight.file2-4.cjs.map -``` - -## preflight.inflightclass-5.cjs -```cjs -"use strict"; -const $stdlib = require('@winglang/sdk'); -const std = $stdlib.std; -const $helpers = $stdlib.helpers; -const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; -class InflightClass extends $stdlib.std.Resource { - constructor($scope, $id, ) { - super($scope, $id); - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.InflightClass-4.cjs")({ - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const InflightClassClient = ${InflightClass._toInflightType()}; - const client = new InflightClassClient({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "method": [ - ], - "$inflight_init": [ - ], - }); - } -} -if ($preflightTypesMap[5]) { throw new Error("InflightClass is already in type map"); } -$preflightTypesMap[5] = InflightClass; -module.exports = { $preflightTypesMap, InflightClass }; -//# sourceMappingURL=preflight.inflightclass-5.cjs.map -``` - -## preflight.inner-2.cjs -```cjs -"use strict"; -const $stdlib = require('@winglang/sdk'); -const std = $stdlib.std; -const $helpers = $stdlib.helpers; -const $extern = $helpers.createExternRequire(__dirname); -const $preflightTypesMap = {}; -Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.widget-1.cjs`, $preflightTypesMap)); -module.exports = { ...module.exports, $preflightTypesMap }; -//# sourceMappingURL=preflight.inner-2.cjs.map -``` - -## preflight.subdir2-6.cjs -```cjs -"use strict"; -const $stdlib = require('@winglang/sdk'); -const std = $stdlib.std; -const $helpers = $stdlib.helpers; -const $extern = $helpers.createExternRequire(__dirname); -const $preflightTypesMap = {}; -Object.assign(module.exports, { get inner() { return $helpers.bringJs(`${__dirname}/preflight.inner-2.cjs`, $preflightTypesMap); } }); -Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.inflightclass-5.cjs`, $preflightTypesMap)); -Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.file2-4.cjs`, $preflightTypesMap)); -Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.file1-3.cjs`, $preflightTypesMap)); -module.exports = { ...module.exports, $preflightTypesMap }; -//# sourceMappingURL=preflight.subdir2-6.cjs.map -``` - -## preflight.widget-1.cjs -```cjs -"use strict"; -const $stdlib = require('@winglang/sdk'); -const std = $stdlib.std; -const $helpers = $stdlib.helpers; -const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; -class Widget extends $stdlib.std.Resource { - constructor($scope, $id, ) { - super($scope, $id); - } - compute() { - return 42; - } - static staticCompute($scope) { - return 1337; - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.Widget-1.cjs")({ - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const WidgetClient = ${Widget._toInflightType()}; - const client = new WidgetClient({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "$inflight_init": [ - ], - }); - } -} -module.exports = { $preflightTypesMap, Widget }; -//# sourceMappingURL=preflight.widget-1.cjs.map -``` - diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_preflight_object.test.w_test_sim.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_preflight_object.test.w_test_sim.md index e7220befa0b..e9aae34f065 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_preflight_object.test.w_test_sim.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_preflight_object.test.w_test_sim.md @@ -2,13 +2,9 @@ ## stdout.log ```log -pass ─ inflight_class_capture_preflight_object.test.wsim » root/env0/test:inflight class captures preflight resource -pass ─ inflight_class_capture_preflight_object.test.wsim » root/env1/test:inflight class type captures preflight resource -pass ─ inflight_class_capture_preflight_object.test.wsim » root/env2/test:inflight class qualified without explicit reference -pass ─ inflight_class_capture_preflight_object.test.wsim » root/env3/test:inflight class defined inflight captures preflight object -pass ─ inflight_class_capture_preflight_object.test.wsim » root/env4/test:bring inflight class from subdir +pass ─ inflight_class_capture_preflight_object.test.wsim (no tests) -Tests 5 passed (5) +Tests 1 passed (1) Snapshots 1 skipped Test Files 1 passed (1) Duration diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_definitions.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_definitions.test.w_compile_tf-aws.md index 7b51ee2ebbf..e537abc4187 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_definitions.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_definitions.test.w_compile_tf-aws.md @@ -181,9 +181,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -247,8 +244,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[2]) { throw new Error("B is already in type map"); } - $preflightTypesMap[2] = B; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -347,8 +342,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[8]) { throw new Error("F is already in type map"); } - $preflightTypesMap[8] = F; class $Closure2 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -376,12 +369,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$helpers.preflightClassSingleton(this, 8), ["foo"]], - [F, ["foo"]], ], "$inflight_init": [ - [$helpers.preflightClassSingleton(this, 8), []], - [F, []], ], }); } @@ -451,16 +440,12 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$helpers.preflightClassSingleton(this, 2), ["foo"]], - [B, []], [a, ["goo"]], [d, ["callInner"]], [fn, ["handle"]], [innerD, ["handle"]], ], "$inflight_init": [ - [$helpers.preflightClassSingleton(this, 2), []], - [B, []], [a, []], [d, []], [fn, []], diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_inner_capture_mutable.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_inner_capture_mutable.test.w_compile_tf-aws.md index 7486f263ddb..dabe240a3a0 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_inner_capture_mutable.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_inner_capture_mutable.test.w_compile_tf-aws.md @@ -59,13 +59,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_inside_inflight_closure.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_inside_inflight_closure.test.w_compile_tf-aws.md index 1901d050321..856df8223f3 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_inside_inflight_closure.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_inside_inflight_closure.test.w_compile_tf-aws.md @@ -239,13 +239,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class PreflightClass extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_modifiers.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_modifiers.test.w_compile_tf-aws.md index 9a3dfce7fbf..8e93c5ec0c9 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_modifiers.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_modifiers.test.w_compile_tf-aws.md @@ -50,9 +50,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class C extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -86,8 +83,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("C is already in type map"); } - $preflightTypesMap[1] = C; } } const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_outside_inflight_closure.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_outside_inflight_closure.test.w_compile_tf-aws.md index 9384086dc1a..0c04970c411 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_outside_inflight_closure.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_outside_inflight_closure.test.w_compile_tf-aws.md @@ -70,13 +70,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class BinaryOperation extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -113,8 +110,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("BinaryOperation is already in type map"); } - $preflightTypesMap[1] = BinaryOperation; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -142,12 +137,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$helpers.preflightClassSingleton(this, 1), ["add"]], - [BinaryOperation, []], ], "$inflight_init": [ - [$helpers.preflightClassSingleton(this, 1), []], - [BinaryOperation, []], ], }); } diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_structural_interace_handler.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_structural_interace_handler.test.w_compile_tf-aws.md index 8a655af51ed..983628a34c9 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_structural_interace_handler.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_structural_interace_handler.test.w_compile_tf-aws.md @@ -74,15 +74,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class NotGoo extends $stdlib.std.Resource { - _id = $stdlib.core.closureId(); constructor($scope, $id, ) { super($scope, $id); } @@ -112,8 +108,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("NotGoo is already in type map"); } - $preflightTypesMap[1] = NotGoo; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -141,10 +135,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [NotGoo, []], ], "$inflight_init": [ - [NotGoo, []], ], }); } diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_without_init.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_without_init.test.w_compile_tf-aws.md index f7b737fd9b7..2b1a60b79bb 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_without_init.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_without_init.test.w_compile_tf-aws.md @@ -60,13 +60,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -95,8 +92,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("Foo is already in type map"); } - $preflightTypesMap[1] = Foo; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -124,10 +119,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [Foo, []], ], "$inflight_init": [ - [Foo, []], ], }); } diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_as_super_param.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_as_super_param.test.w_compile_tf-aws.md index f9e7a4dc4a0..90f1cc224eb 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_as_super_param.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_as_super_param.test.w_compile_tf-aws.md @@ -114,9 +114,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_autoid.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_autoid.test.w_compile_tf-aws.md index f960ed7ec92..3053064bc53 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_autoid.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_autoid.test.w_compile_tf-aws.md @@ -73,9 +73,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure2 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_inside_preflight_closure.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_inside_preflight_closure.test.w_compile_tf-aws.md index 1504fc3015e..f12ec6a9126 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_inside_preflight_closure.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_inside_preflight_closure.test.w_compile_tf-aws.md @@ -64,9 +64,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_concat.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_concat.test.w_compile_tf-aws.md index 054dbbd2863..fcd905fd09c 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_concat.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_concat.test.w_compile_tf-aws.md @@ -46,13 +46,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class R extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_handler_singleton.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_handler_singleton.test.w_compile_tf-aws.md index b49cf2c35f0..ef4d5090935 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_handler_singleton.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_handler_singleton.test.w_compile_tf-aws.md @@ -434,15 +434,12 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const expect = $stdlib.expect; +const util = $stdlib.util; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const expect = $stdlib.expect; - const util = $stdlib.util; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -577,13 +574,11 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), ["equal"]], [fn, ["invoke"]], [fn2, ["invoke"]], [sim, []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), []], [fn, []], [fn2, []], [sim, []], @@ -620,13 +615,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(std.Duration, "@winglang/sdk/std", "Duration"), ["fromSeconds"]], - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), ["sleep"]], [foo, [].concat(["inc"], ["get"])], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(std.Duration, "@winglang/sdk/std", "Duration"), []], - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), []], [foo, []], ], }); @@ -661,13 +652,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(std.Duration, "@winglang/sdk/std", "Duration"), ["fromSeconds"]], - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), ["sleep"]], [fn3, [].concat(["invokeAsync"], ["invoke"])], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(std.Duration, "@winglang/sdk/std", "Duration"), []], - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), []], [fn3, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_init.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_init.test.w_compile_tf-aws.md index fae9583fd66..107f59abfa7 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_init.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_init.test.w_compile_tf-aws.md @@ -192,13 +192,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const jsii_fixture = require("jsii-fixture"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const jsii_fixture = require("jsii-fixture"); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -234,8 +231,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("Foo is already in type map"); } - $preflightTypesMap[1] = Foo; class FooChild extends Foo { constructor($scope, $id, ) { super($scope, $id); @@ -268,8 +263,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[2]) { throw new Error("FooChild is already in type map"); } - $preflightTypesMap[2] = FooChild; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -297,12 +290,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$helpers.preflightClassSingleton(this, 1), [].concat(["field1"], ["field2"])], - [Foo, []], ], "$inflight_init": [ - [$helpers.preflightClassSingleton(this, 1), []], - [Foo, []], ], }); } @@ -334,12 +323,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$helpers.preflightClassSingleton(this, 2), [].concat(["field1"], ["field2"], ["field3"])], - [FooChild, []], ], "$inflight_init": [ - [$helpers.preflightClassSingleton(this, 2), []], - [FooChild, []], ], }); } @@ -403,10 +388,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(jsii_fixture.JsiiClass, "jsii-fixture", "JsiiClass"), []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(jsii_fixture.JsiiClass, "jsii-fixture", "JsiiClass"), []], ], }); } diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflights_calling_inflights.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflights_calling_inflights.test.w_compile_tf-aws.md index 4141cadd9c9..5ed1e8afb45 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflights_calling_inflights.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflights_calling_inflights.test.w_compile_tf-aws.md @@ -272,13 +272,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inherit_stdlib_class.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inherit_stdlib_class.test.w_compile_tf-aws.md index f23be52247e..605a0562d1d 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inherit_stdlib_class.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inherit_stdlib_class.test.w_compile_tf-aws.md @@ -289,14 +289,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const http = $stdlib.http; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const http = $stdlib.http; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class AnApi extends (this?.node?.root?.typeForFqn("@winglang/sdk.cloud.Api") ?? cloud.Api) { constructor($scope, $id, ) { super($scope, $id); @@ -386,11 +383,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), ["get"]], [api.url, []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), []], [api.url, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inheritance_class_inflight.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inheritance_class_inflight.test.w_compile_tf-aws.md index 0a09272fbde..28e66cf857a 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inheritance_class_inflight.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inheritance_class_inflight.test.w_compile_tf-aws.md @@ -91,13 +91,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const expect = $stdlib.expect; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const expect = $stdlib.expect; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class FooBase extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -191,11 +188,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), ["equal"]], [foo, [].concat(["bang"], ["bug"], ["over_inflight"])], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), []], [foo, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inheritance_class_preflight.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inheritance_class_preflight.test.w_compile_tf-aws.md index e8d29f44d7c..0675acb048d 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inheritance_class_preflight.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inheritance_class_preflight.test.w_compile_tf-aws.md @@ -57,13 +57,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const expect = $stdlib.expect; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const expect = $stdlib.expect; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class FooBase extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inheritance_interface.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inheritance_interface.test.w_compile_tf-aws.md index 8250a5117e6..1cfce89b825 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inheritance_interface.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inheritance_interface.test.w_compile_tf-aws.md @@ -42,13 +42,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const expect = $stdlib.expect; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const expect = $stdlib.expect; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Baz extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/interface.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/interface.test.w_compile_tf-aws.md index 5ae5aa0d286..25d7dcdd312 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/interface.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/interface.test.w_compile_tf-aws.md @@ -59,9 +59,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class C extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/intrinsics.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/intrinsics.test.w_compile_tf-aws.md index 38278f5cf41..826fa5f8c0b 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/intrinsics.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/intrinsics.test.w_compile_tf-aws.md @@ -75,18 +75,6 @@ module.exports = function({ $counter }) { //# sourceMappingURL=inflight.Example-2.cjs.map ``` -## inflight.InflightBar-1.cjs -```cjs -"use strict"; -const $helpers = require("@winglang/sdk/lib/helpers"); -module.exports = function({ }) { - class InflightBar { - } - return InflightBar; -} -//# sourceMappingURL=inflight.InflightBar-1.cjs.map -``` - ## main.tf.json ```json { @@ -238,7 +226,6 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; class Bar extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -273,37 +260,7 @@ class Bar extends $stdlib.std.Resource { }); } } -class InflightBar extends $stdlib.std.Resource { - constructor($scope, $id, ) { - super($scope, $id); - } - static _toInflightType() { - return ` - require("${$helpers.normalPath(__dirname)}/inflight.InflightBar-1.cjs")({ - }) - `; - } - _toInflight() { - return ` - (await (async () => { - const InflightBarClient = ${InflightBar._toInflightType()}; - const client = new InflightBarClient({ - }); - if (client.$inflight_init) { await client.$inflight_init(); } - return client; - })()) - `; - } - get _liftMap() { - return ({ - "$inflight_init": [ - ], - }); - } -} -if ($preflightTypesMap[2]) { throw new Error("InflightBar is already in type map"); } -$preflightTypesMap[2] = InflightBar; -module.exports = { $preflightTypesMap, Bar, InflightBar }; +module.exports = { Bar }; //# sourceMappingURL=preflight.bar-1.cjs.map ``` @@ -317,17 +274,14 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const fs = $stdlib.fs; +const expect = $stdlib.expect; +const cloud = $stdlib.cloud; +const util = $stdlib.util; +const bar = require("./preflight.bar-1.cjs"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const fs = $stdlib.fs; - const expect = $stdlib.expect; - const cloud = $stdlib.cloud; - const util = $stdlib.util; - const bar = $helpers.bringJs(`${__dirname}/preflight.bar-1.cjs`, $preflightTypesMap); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Example extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/issue_2889.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/issue_2889.test.w_compile_tf-aws.md index f59607ffdf5..28a3a575564 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/issue_2889.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/issue_2889.test.w_compile_tf-aws.md @@ -277,14 +277,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const http = $stdlib.http; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const http = $stdlib.http; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -312,10 +309,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), [].concat(["parse"], ["stringify"])], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), []], ], }); } @@ -349,13 +344,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), ["get"]], - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), ["parse"]], [api.url, []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), []], - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), []], [api.url, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/json.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/json.test.w_compile_tf-aws.md index b3e36dff030..2bafdc5c8a2 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/json.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/json.test.w_compile_tf-aws.md @@ -66,13 +66,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/json_bucket.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/json_bucket.test.w_compile_tf-aws.md index 22f947fe294..0774d81ea04 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/json_bucket.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/json_bucket.test.w_compile_tf-aws.md @@ -187,13 +187,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/json_static.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/json_static.test.w_compile_tf-aws.md index 4c64066df78..c707fb3a1fa 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/json_static.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/json_static.test.w_compile_tf-aws.md @@ -71,13 +71,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -106,11 +103,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), ["stringify"]], [jj, []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), []], [jj, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/json_string_interpolation.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/json_string_interpolation.test.w_compile_tf-aws.md index b0b433492ed..e2fc9034d6b 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/json_string_interpolation.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/json_string_interpolation.test.w_compile_tf-aws.md @@ -31,9 +31,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const obj = ({"strValue": "test", "numValue": 1}); const notStringifyStrValue = String.raw({ raw: ["string: ", ""] }, JSON.stringify(((obj, args) => { if (obj[args] === undefined) throw new Error(`Json property "${args}" does not exist`); return obj[args] })(obj, "strValue"))); $helpers.assert($helpers.eq(notStringifyStrValue, "string: \"test\""), "notStringifyStrValue == \"string: \\\"test\\\"\""); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_expr_with_this.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_expr_with_this.test.w_compile_tf-aws.md index 2d175572d59..0b2bd167ff6 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_expr_with_this.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_expr_with_this.test.w_compile_tf-aws.md @@ -66,9 +66,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_inflight_closure_collection.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_inflight_closure_collection.test.w_compile_tf-aws.md index 53eeb3794f7..a2e5f968652 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_inflight_closure_collection.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_inflight_closure_collection.test.w_compile_tf-aws.md @@ -637,13 +637,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_inflight_closure_returning_object_issue6501.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_inflight_closure_returning_object_issue6501.test.w_compile_tf-aws.md index 5a63bd27a85..78f61f0bbcd 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_inflight_closure_returning_object_issue6501.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_inflight_closure_returning_object_issue6501.test.w_compile_tf-aws.md @@ -140,13 +140,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -177,8 +174,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[1]) { throw new Error("Foo is already in type map"); } - $preflightTypesMap[1] = Foo; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -206,10 +201,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [Foo, []], ], "$inflight_init": [ - [Foo, []], ], }); } @@ -241,11 +234,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$helpers.preflightClassSingleton(this, 1), ["do"]], [foo, ["handle"]], ], "$inflight_init": [ - [$helpers.preflightClassSingleton(this, 1), []], [foo, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_parent_fields.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_parent_fields.test.w_compile_tf-aws.md index 7357851ee5d..b9b5b77c4ab 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_parent_fields.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_parent_fields.test.w_compile_tf-aws.md @@ -111,9 +111,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_redefinition.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_redefinition.test.w_compile_tf-aws.md index 8ae9c48474d..7b0d6b976a7 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_redefinition.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_redefinition.test.w_compile_tf-aws.md @@ -53,9 +53,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_shared_resource.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_shared_resource.test.w_compile_tf-aws.md index 3ebdba3c8b7..7ed560804f7 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_shared_resource.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_shared_resource.test.w_compile_tf-aws.md @@ -305,14 +305,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const http = $stdlib.http; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const http = $stdlib.http; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyBucket extends $stdlib.std.Resource { constructor($scope, $id, bucket) { super($scope, $id); @@ -413,11 +410,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), ["get"]], [api.url, []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), []], [api.url, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_this.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_this.test.w_compile_tf-aws.md index 5d669059063..a71a833cc41 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_this.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_this.test.w_compile_tf-aws.md @@ -72,13 +72,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const util = $stdlib.util; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const util = $stdlib.util; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -147,11 +144,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), ["env"]], [f, ["foo"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), []], [f, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_via_closure.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_via_closure.test.w_compile_tf-aws.md index d730cf7808b..b1bfee214a8 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_via_closure.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_via_closure.test.w_compile_tf-aws.md @@ -145,13 +145,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_via_closure_explicit.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_via_closure_explicit.test.w_compile_tf-aws.md index c20d2d303cd..09892856fa3 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_via_closure_explicit.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_via_closure_explicit.test.w_compile_tf-aws.md @@ -84,13 +84,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyClosure extends $stdlib.std.Resource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_weird_order.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_weird_order.test.w_compile_tf-aws.md index dcedef2d843..267393b209b 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_weird_order.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_weird_order.test.w_compile_tf-aws.md @@ -86,9 +86,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class B extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_with_phase_ind.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_with_phase_ind.test.w_compile_tf-aws.md index d4c7ea807d1..eda26b8fc99 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_with_phase_ind.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_with_phase_ind.test.w_compile_tf-aws.md @@ -55,13 +55,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const math = $stdlib.math; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const math = $stdlib.math; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -90,11 +87,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(math.Util, "@winglang/sdk/math", "Util"), [].concat(["floor"], ["random"])], [ar, [].concat(["at"], ["length"], ["copyMut"])], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(math.Util, "@winglang/sdk/math", "Util"), []], [ar, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/map_entries.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/map_entries.test.w_compile_tf-aws.md index 24e28ee1f7f..c50b025eeeb 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/map_entries.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/map_entries.test.w_compile_tf-aws.md @@ -118,9 +118,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/mut_container_types.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/mut_container_types.test.w_compile_tf-aws.md index a39a45436db..4664729ab76 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/mut_container_types.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/mut_container_types.test.w_compile_tf-aws.md @@ -62,13 +62,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const bucket1 = this.node.root.new("@winglang/sdk.cloud.Bucket", cloud.Bucket, this, "bucket1"); const bucket2 = this.node.root.new("@winglang/sdk.cloud.Bucket", cloud.Bucket, this, "bucket2"); const bucket3 = this.node.root.new("@winglang/sdk.cloud.Bucket", cloud.Bucket, this, "bucket3"); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/mutation_after_class_init.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/mutation_after_class_init.test.w_compile_tf-aws.md index 36326b84129..cc3f653a9d3 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/mutation_after_class_init.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/mutation_after_class_init.test.w_compile_tf-aws.md @@ -339,14 +339,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const util = $stdlib.util; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const util = $stdlib.util; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Queue extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -518,12 +515,10 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), ["waitUntil"]], [c, ["peek"]], [q, ["push"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), []], [c, []], [q, []], ], diff --git a/tools/hangar/__snapshots__/test_corpus/valid/new_in_static.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/new_in_static.test.w_compile_tf-aws.md index 2ee9924e3f6..94699c966bf 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/new_in_static.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/new_in_static.test.w_compile_tf-aws.md @@ -174,16 +174,13 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const c = require("constructs"); +const jsii_fixture = require("jsii-fixture"); +const new_in_static_lib = require("./preflight.newinstaticlib-1.cjs"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const c = require("constructs"); - const jsii_fixture = require("jsii-fixture"); - const new_in_static_lib = $helpers.bringJs(`${__dirname}/preflight.newinstaticlib-1.cjs`, $preflightTypesMap); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class MyClass extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -361,7 +358,6 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -421,7 +417,7 @@ class LibClass extends $stdlib.std.Resource { }); } } -module.exports = { $preflightTypesMap, Foo, LibClass }; +module.exports = { Foo, LibClass }; //# sourceMappingURL=preflight.newinstaticlib-1.cjs.map ``` diff --git a/tools/hangar/__snapshots__/test_corpus/valid/new_in_static_lib.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/new_in_static_lib.w_compile_tf-aws.md index 9905f1aa986..2600606fde2 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/new_in_static_lib.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/new_in_static_lib.w_compile_tf-aws.md @@ -35,7 +35,6 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -95,7 +94,7 @@ class LibClass extends $stdlib.std.Resource { }); } } -module.exports = { $preflightTypesMap, Foo, LibClass }; +module.exports = { Foo, LibClass }; //# sourceMappingURL=preflight.cjs.map ``` diff --git a/tools/hangar/__snapshots__/test_corpus/valid/new_jsii.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/new_jsii.test.w_compile_tf-aws.md index 4adf970a686..6ddb1f36591 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/new_jsii.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/new_jsii.test.w_compile_tf-aws.md @@ -56,13 +56,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class CustomScope extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/nil.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/nil.test.w_compile_tf-aws.md index 69b29e866b7..f532f728ef4 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/nil.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/nil.test.w_compile_tf-aws.md @@ -104,13 +104,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/on_lift.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/on_lift.test.w_compile_tf-aws.md index 325aa8db4a3..7e78d7ad70d 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/on_lift.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/on_lift.test.w_compile_tf-aws.md @@ -71,13 +71,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const util = $stdlib.util; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const util = $stdlib.util; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -113,17 +110,14 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "m1": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), ["env"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), []], ], }); } static get _liftTypeMap() { return ({ "m2": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), ["env"]], ], }); } diff --git a/tools/hangar/__snapshots__/test_corpus/valid/optionals.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/optionals.test.w_compile_tf-aws.md index d8d0f7ef0f3..0ea88a8d77f 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/optionals.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/optionals.test.w_compile_tf-aws.md @@ -123,14 +123,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; const Person = $stdlib.std.Struct._createJsonSchema({$id:"/Person",type:"object",properties:{age:{type:"number"},name:{type:"string"},},required:["age","name",]}); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Super extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/parameters/nested/parameters.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/parameters/nested/parameters.test.w_compile_tf-aws.md index d98bb1e2e87..3503181bdfd 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/parameters/nested/parameters.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/parameters/nested/parameters.test.w_compile_tf-aws.md @@ -31,10 +31,7 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; const MyParams = $stdlib.std.Struct._createJsonSchema({$id:"/MyParams",type:"object",properties:{houses:{type:"array",items:{type:"object",properties:{address:{type:"string"},residents:{type:"array",items:{type:"object",properties:{age:{type:"number"},name:{type:"string"},},required:["age","name",]}},},required:["address","residents",]}},},required:["houses",]}); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const app = $helpers.nodeof(this).app; const myParams = MyParams._fromJson((app.parameters.read({ schema: MyParams }))); $helpers.assert($helpers.eq(myParams.houses.length, 2), "myParams.houses.length == 2"); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/parameters/simple/parameters.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/parameters/simple/parameters.test.w_compile_tf-aws.md index caa21223aea..e304cb025bd 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/parameters/simple/parameters.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/parameters/simple/parameters.test.w_compile_tf-aws.md @@ -31,10 +31,7 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; const MyParams = $stdlib.std.Struct._createJsonSchema({$id:"/MyParams",type:"object",properties:{foo:{type:"string"},meaningOfLife:{type:"number"},},required:["meaningOfLife",]}); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const app = $helpers.nodeof(this).app; const myParams = MyParams._fromJson((app.parameters.read({ schema: MyParams }))); { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/phase_independent_method_on_string.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/phase_independent_method_on_string.test.w_compile_tf-aws.md index 16a89f4f03c..9bf16ceb677 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/phase_independent_method_on_string.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/phase_independent_method_on_string.test.w_compile_tf-aws.md @@ -136,14 +136,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const expect = $stdlib.expect; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const expect = $stdlib.expect; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -174,13 +171,11 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), [].concat(["equal"], ["notEqual"])], [api.url, [].concat(["startsWith"], ["length"])], [tokenLength, []], [urlRegex, ["test"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), []], [api.url, []], [tokenLength, []], [urlRegex, []], diff --git a/tools/hangar/__snapshots__/test_corpus/valid/primitive_methods.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/primitive_methods.test.w_compile_tf-aws.md index 7d06eb6d50c..b1371d2ece1 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/primitive_methods.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/primitive_methods.test.w_compile_tf-aws.md @@ -31,9 +31,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const dur = (std.Duration.fromSeconds(60)); const dur2 = (std.Duration.fromSeconds(600)); const f = ((d) => { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/print.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/print.test.w_compile_tf-aws.md index 58710b5f17d..a01629c4119 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/print.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/print.test.w_compile_tf-aws.md @@ -70,13 +70,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/reassignment.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/reassignment.test.w_compile_tf-aws.md index d45eb465d4e..9a2f46ad429 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/reassignment.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/reassignment.test.w_compile_tf-aws.md @@ -45,9 +45,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class R extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/redis.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/redis.test.w_compile_tf-aws.md index d398c6056c9..df675212cda 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/redis.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/redis.test.w_compile_tf-aws.md @@ -681,15 +681,12 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const util = $stdlib.util; +const ex = $stdlib.ex; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const util = $stdlib.util; - const ex = $stdlib.ex; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -755,13 +752,11 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), ["waitUntil"]], [queue, ["push"]], [r, ["get"]], [r2, [].concat(["set"], ["get"])], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), []], [queue, []], [r, []], [r2, []], diff --git a/tools/hangar/__snapshots__/test_corpus/valid/resource.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/resource.test.w_compile_tf-aws.md index 3117975832c..c53272518fe 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/resource.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/resource.test.w_compile_tf-aws.md @@ -708,14 +708,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const util = $stdlib.util; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const util = $stdlib.util; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const MyEnum = (function (tmp) { tmp["A"] = "A"; @@ -809,13 +806,11 @@ class $Root extends $stdlib.std.Resource { "testTypeAccess": [ [Bar, ["barStatic"]], [Foo, ["fooStatic"]], - [MyEnum, ["B"]], [this.e, []], ], "$inflight_init": [ [Bar, []], [Foo, []], - [MyEnum, []], [this.b, []], [this.e, []], [this.foo, []], @@ -1057,11 +1052,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), ["waitUntil"]], [bigOlPublisher, [].concat(["publish"], ["getObjectCount"])], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), []], [bigOlPublisher, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/resource_as_inflight_literal.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/resource_as_inflight_literal.test.w_compile_tf-aws.md index 36da9581699..4ae8a6f7e61 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/resource_as_inflight_literal.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/resource_as_inflight_literal.test.w_compile_tf-aws.md @@ -174,13 +174,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/resource_call_static.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/resource_call_static.test.w_compile_tf-aws.md index c0ef8f3ca0f..0509113ee0e 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/resource_call_static.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/resource_call_static.test.w_compile_tf-aws.md @@ -86,13 +86,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Another extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/resource_captures.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/resource_captures.test.w_compile_tf-aws.md index 41bd603ecf9..e3a9b7f7cbe 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/resource_captures.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/resource_captures.test.w_compile_tf-aws.md @@ -240,13 +240,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class First extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/resource_captures_globals.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/resource_captures_globals.test.w_compile_tf-aws.md index c3d106d17c4..83635822e9d 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/resource_captures_globals.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/resource_captures_globals.test.w_compile_tf-aws.md @@ -362,14 +362,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const util = $stdlib.util; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const util = $stdlib.util; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class First extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -520,7 +517,6 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "myPut": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), ["waitUntil"]], [Another, ["myStaticMethod"]], [globalAnother, ["myMethod"]], [globalAnother.first.myResource, ["put"]], @@ -536,7 +532,6 @@ class $Root extends $stdlib.std.Resource { [this.localTopic, ["publish"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(util.Util, "@winglang/sdk/util", "Util"), []], [Another, []], [globalAnother, []], [globalAnother.first.myResource, []], diff --git a/tools/hangar/__snapshots__/test_corpus/valid/service.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/service.test.w_compile_tf-aws.md index 217349b8a7d..72c0fe616c3 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/service.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/service.test.w_compile_tf-aws.md @@ -31,9 +31,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; } } const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/shadowing.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/shadowing.test.w_compile_tf-aws.md index a5c64b95b56..f0b9fecca15 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/shadowing.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/shadowing.test.w_compile_tf-aws.md @@ -80,13 +80,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/sim_resource.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/sim_resource.test.w_compile_tf-aws.md index 7711b440596..fd0ae7a5677 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/sim_resource.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/sim_resource.test.w_compile_tf-aws.md @@ -75,13 +75,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const sim = $stdlib.sim; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const sim = $stdlib.sim; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const MyEnum = (function (tmp) { tmp["A"] = "A"; @@ -129,7 +126,6 @@ class $Root extends $stdlib.std.Resource { "methodWithJsons": [ ], "methodWithEnums": [ - [MyEnum, ["A"]], ], "methodWithArrays": [ ], @@ -142,13 +138,10 @@ class $Root extends $stdlib.std.Resource { "methodWithComplexTypes": [ ], "$inflight_init": [ - [MyEnum, []], ], }); } } - if ($preflightTypesMap[1]) { throw new Error("ResourceBackend is already in type map"); } - $preflightTypesMap[1] = ResourceBackend; } } const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/statements_before_super.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/statements_before_super.w_compile_tf-aws.md index 87c6fd80fb3..7fdd23242c0 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/statements_before_super.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/statements_before_super.w_compile_tf-aws.md @@ -36,7 +36,6 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; class A extends $stdlib.std.Resource { constructor($scope, $id, a) { super($scope, $id); @@ -96,7 +95,7 @@ class B extends A { }); } } -module.exports = { $preflightTypesMap, }; +module.exports = { }; //# sourceMappingURL=preflight.cjs.map ``` diff --git a/tools/hangar/__snapshots__/test_corpus/valid/statements_if.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/statements_if.test.w_compile_tf-aws.md index 62dfa63453e..30eb8fa4754 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/statements_if.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/statements_if.test.w_compile_tf-aws.md @@ -67,13 +67,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/statements_variable_declarations.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/statements_variable_declarations.test.w_compile_tf-aws.md index e4d65b4ad3f..8d74f4b9971 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/statements_variable_declarations.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/statements_variable_declarations.test.w_compile_tf-aws.md @@ -31,9 +31,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const x = 2; const y = x; const id = 1; diff --git a/tools/hangar/__snapshots__/test_corpus/valid/static_members.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/static_members.test.w_compile_tf-aws.md index 889b4c06696..780b990a746 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/static_members.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/static_members.test.w_compile_tf-aws.md @@ -75,13 +75,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/std_containers.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/std_containers.test.w_compile_tf-aws.md index 2c88436783f..d6009c0537f 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/std_containers.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/std_containers.test.w_compile_tf-aws.md @@ -75,9 +75,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Animal extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/std_string.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/std_string.test.w_compile_tf-aws.md index 7e6b876f3f0..9838e17fea0 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/std_string.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/std_string.test.w_compile_tf-aws.md @@ -53,9 +53,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/store.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/store.w_compile_tf-aws.md index 2fc82a4643e..5afb35fc2ee 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/store.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/store.w_compile_tf-aws.md @@ -59,8 +59,7 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; -const file3 = $helpers.bringJs(`${__dirname}/preflight.empty-1.cjs`, $preflightTypesMap); +const file3 = require("./preflight.empty-1.cjs"); const math = $stdlib.math; const cloud = $stdlib.cloud; const Color = @@ -170,7 +169,7 @@ class Store extends $stdlib.std.Resource { }); } } -module.exports = { $preflightTypesMap, Util, Store, Color }; +module.exports = { Util, Store, Color }; //# sourceMappingURL=preflight.cjs.map ``` @@ -181,8 +180,7 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; -module.exports = { $preflightTypesMap, }; +module.exports = { }; //# sourceMappingURL=preflight.empty-1.cjs.map ``` diff --git a/tools/hangar/__snapshots__/test_corpus/valid/stringify.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/stringify.test.w_compile_tf-aws.md index c7c2345a711..abf6a1f0424 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/stringify.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/stringify.test.w_compile_tf-aws.md @@ -31,9 +31,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const MyEnum = (function (tmp) { tmp["A"] = "A"; diff --git a/tools/hangar/__snapshots__/test_corpus/valid/struct_from_json.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/struct_from_json.test.w_compile_tf-aws.md index 65c76f35127..dbd874c1694 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/struct_from_json.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/struct_from_json.test.w_compile_tf-aws.md @@ -176,14 +176,12 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const externalStructs = require("./preflight.structs-1.cjs"); +const otherExternalStructs = require("./preflight.structs2-2.cjs"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const externalStructs = $helpers.bringJs(`${__dirname}/preflight.structs-1.cjs`, $preflightTypesMap); - const otherExternalStructs = $helpers.bringJs(`${__dirname}/preflight.structs2-2.cjs`, $preflightTypesMap); const Bar = $stdlib.std.Struct._createJsonSchema({$id:"/Bar",type:"object",properties:{b:{type:"number"},f:{type:"string"},},required:["b","f",]}); const Foo = $stdlib.std.Struct._createJsonSchema({$id:"/Foo",type:"object",properties:{f:{type:"string"},},required:["f",]}); const Foosible = $stdlib.std.Struct._createJsonSchema({$id:"/Foosible",type:"object",properties:{f:{type:"string"},},required:[]}); @@ -191,7 +189,6 @@ class $Root extends $stdlib.std.Resource { const Student = $stdlib.std.Struct._createJsonSchema({$id:"/Student",type:"object",properties:{additionalData:{type:["object","string","boolean","number","array"]},advisor:{type:"object",properties:{dob:{type:"object",properties:{day:{type:"number"},month:{type:"number"},year:{type:"number"},},required:["day","month","year",]},employeeID:{type:"string"},firstName:{type:"string"},lastName:{type:"string"},},required:["dob","employeeID","firstName","lastName",]},coursesTaken:{type:"array",items:{type:"object",properties:{course:{type:"object",properties:{credits:{type:"number"},name:{type:"string"},},required:["credits","name",]},dateTaken:{type:"object",properties:{day:{type:"number"},month:{type:"number"},year:{type:"number"},},required:["day","month","year",]},grade:{type:"string"},},required:["course","dateTaken","grade",]}},dob:{type:"object",properties:{day:{type:"number"},month:{type:"number"},year:{type:"number"},},required:["day","month","year",]},enrolled:{type:"boolean"},enrolledCourses:{type:"array",uniqueItems:true,items:{type:"object",properties:{credits:{type:"number"},name:{type:"string"},},required:["credits","name",]}},firstName:{type:"string"},lastName:{type:"string"},schoolId:{type:"string"},},required:["dob","enrolled","firstName","lastName","schoolId",]}); const cloud_BucketProps = $stdlib.std.Struct._createJsonSchema({$id:"/BucketProps",type:"object",properties:{public:{type:"boolean"},},required:[]}); const externalStructs_MyOtherStruct = $stdlib.std.Struct._createJsonSchema({$id:"/MyOtherStruct",type:"object",properties:{data:{type:"object",properties:{val:{type:"number"},},required:["val",]},},required:["data",]}); - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -220,11 +217,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(cloud_BucketProps, "@winglang/sdk/cloud", "BucketProps"), ["fromJson"]], [j, []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(cloud_BucketProps, "@winglang/sdk/cloud", "BucketProps"), []], [j, []], ], }); @@ -257,10 +252,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [Student, ["fromJson"]], ], "$inflight_init": [ - [Student, []], ], }); } @@ -293,11 +286,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [Student, ["fromJson"]], [jStudent1, []], ], "$inflight_init": [ - [Student, []], [jStudent1, []], ], }); @@ -334,15 +325,11 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), ["stringify"]], - [MyStruct, ["schema"]], [expectedSchema, []], [jMyStruct, []], [schema, ["asStr"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), []], - [MyStruct, []], [expectedSchema, []], [jMyStruct, []], [schema, []], @@ -380,16 +367,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(std.Boolean, "@winglang/sdk/std", "Boolean"), ["fromJson"]], - [$stdlib.core.toLiftableModuleType(std.Number, "@winglang/sdk/std", "Number"), ["fromJson"]], - [$stdlib.core.toLiftableModuleType(std.String, "@winglang/sdk/std", "String"), ["fromJson"]], - [Student, ["fromJson"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(std.Boolean, "@winglang/sdk/std", "Boolean"), []], - [$stdlib.core.toLiftableModuleType(std.Number, "@winglang/sdk/std", "Number"), []], - [$stdlib.core.toLiftableModuleType(std.String, "@winglang/sdk/std", "String"), []], - [Student, []], ], }); } @@ -532,8 +511,7 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; -module.exports = { $preflightTypesMap, }; +module.exports = { }; //# sourceMappingURL=preflight.structs-1.cjs.map ``` @@ -544,7 +522,6 @@ const $stdlib = require('@winglang/sdk'); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); -let $preflightTypesMap = {}; const SomeStruct = $stdlib.std.Struct._createJsonSchema({$id:"/SomeStruct",type:"object",properties:{foo:{type:"string"},},required:["foo",]}); class UsesStructInImportedFile extends $stdlib.std.Resource { constructor($scope, $id, ) { @@ -575,7 +552,7 @@ class UsesStructInImportedFile extends $stdlib.std.Resource { }); } } -module.exports = { $preflightTypesMap, UsesStructInImportedFile }; +module.exports = { UsesStructInImportedFile }; //# sourceMappingURL=preflight.structs2-2.cjs.map ``` diff --git a/tools/hangar/__snapshots__/test_corpus/valid/structs.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/structs.test.w_compile_tf-aws.md index 234bfdbe3d8..c7f1e74c5a8 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/structs.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/structs.test.w_compile_tf-aws.md @@ -67,13 +67,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const expect = $stdlib.expect; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const expect = $stdlib.expect; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, b) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/super_call.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/super_call.test.w_compile_tf-aws.md index 083a31cb4d7..def61b603a0 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/super_call.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/super_call.test.w_compile_tf-aws.md @@ -223,14 +223,11 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const expect = $stdlib.expect; +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const expect = $stdlib.expect; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); @@ -415,8 +412,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[6]) { throw new Error("InflightA is already in type map"); } - $preflightTypesMap[6] = InflightA; class InflightB extends InflightA { constructor($scope, $id, ) { super($scope, $id); @@ -448,8 +443,6 @@ class $Root extends $stdlib.std.Resource { }); } } - if ($preflightTypesMap[7]) { throw new Error("InflightB is already in type map"); } - $preflightTypesMap[7] = InflightB; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -478,14 +471,8 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$helpers.preflightClassSingleton(this, 7), ["description"]], - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), ["equal"]], - [InflightB, []], ], "$inflight_init": [ - [$helpers.preflightClassSingleton(this, 7), []], - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), []], - [InflightB, []], ], }); } @@ -585,11 +572,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), ["equal"]], [extended, ["do"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), []], [extended, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/symbol_shadow.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/symbol_shadow.test.w_compile_tf-aws.md index 42b94770984..421ba0afddc 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/symbol_shadow.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/symbol_shadow.test.w_compile_tf-aws.md @@ -123,13 +123,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class A extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/table.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/table.test.w_compile_tf-aws.md index c927d4a3054..0e2da91975a 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/table.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/table.test.w_compile_tf-aws.md @@ -52,13 +52,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const ex = $stdlib.ex; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const ex = $stdlib.ex; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const t = this.node.root.new("@winglang/sdk.ex.Table", ex.Table, this, "Table", { name: "simple-table", primaryKey: "id", columns: ({["id"]: ex.ColumnType.STRING, ["name"]: ex.ColumnType.STRING, ["age"]: ex.ColumnType.NUMBER}) }); } } diff --git a/tools/hangar/__snapshots__/test_corpus/valid/test_bucket.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/test_bucket.test.w_compile_tf-aws.md index 5ea2ff2f6cb..3c3ac279786 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/test_bucket.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/test_bucket.test.w_compile_tf-aws.md @@ -85,13 +85,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/test_without_bring.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/test_without_bring.test.w_compile_tf-aws.md index 599ddd7e22c..7b18f6b34ae 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/test_without_bring.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/test_without_bring.test.w_compile_tf-aws.md @@ -51,9 +51,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/this.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/this.test.w_compile_tf-aws.md index a62860645e0..2356d69988e 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/this.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/this.test.w_compile_tf-aws.md @@ -28,13 +28,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const expect = $stdlib.expect; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const expect = $stdlib.expect; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; const path = $helpers.nodeof(this).path; for (const c of $helpers.nodeof(this).children) { console.log($helpers.nodeof(c).path); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/to_inflight.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/to_inflight.test.w_compile_tf-aws.md index 250004648b3..c6e72bfd406 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/to_inflight.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/to_inflight.test.w_compile_tf-aws.md @@ -62,13 +62,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/try_catch.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/try_catch.test.w_compile_tf-aws.md index ea344d1aede..4010f1331de 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/try_catch.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/try_catch.test.w_compile_tf-aws.md @@ -31,9 +31,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; let x = ""; try { throw new Error("hello"); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/unused_lift.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/unused_lift.test.w_compile_tf-aws.md index ba775e69f5d..096a246a18b 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/unused_lift.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/unused_lift.test.w_compile_tf-aws.md @@ -120,13 +120,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/use_inflight_method_inside_init_closure.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/use_inflight_method_inside_init_closure.test.w_compile_tf-aws.md index 136422bbe26..b66cafb179b 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/use_inflight_method_inside_init_closure.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/use_inflight_method_inside_init_closure.test.w_compile_tf-aws.md @@ -170,13 +170,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { super($scope, $id); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/website_with_api.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/website_with_api.test.w_compile_tf-aws.md index fabea5493dc..692db90b036 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/website_with_api.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/website_with_api.test.w_compile_tf-aws.md @@ -628,16 +628,13 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; +const ex = $stdlib.ex; +const http = $stdlib.http; +const expect = $stdlib.expect; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - const ex = $stdlib.ex; - const http = $stdlib.http; - const expect = $stdlib.expect; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) { @@ -666,11 +663,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), ["stringify"]], [usersTable, ["list"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), []], [usersTable, []], ], }); @@ -704,11 +699,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), [].concat(["parse"], ["stringify"])], [usersTable, ["insert"]], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(std.Json, "@winglang/sdk/std", "Json"), []], [usersTable, []], ], }); @@ -744,15 +737,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), [].concat(["equal"], ["nil"])], - [$stdlib.core.toLiftableModuleType(http.HttpMethod, "@winglang/sdk/http", "HttpMethod"), ["GET"]], - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), ["fetch"]], [api.url, []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), []], - [$stdlib.core.toLiftableModuleType(http.HttpMethod, "@winglang/sdk/http", "HttpMethod"), []], - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), []], [api.url, []], ], }); @@ -788,15 +775,9 @@ class $Root extends $stdlib.std.Resource { get _liftMap() { return ({ "handle": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), ["equal"]], - [$stdlib.core.toLiftableModuleType(http.HttpMethod, "@winglang/sdk/http", "HttpMethod"), ["OPTIONS"]], - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), ["fetch"]], [api.url, []], ], "$inflight_init": [ - [$stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"), []], - [$stdlib.core.toLiftableModuleType(http.HttpMethod, "@winglang/sdk/http", "HttpMethod"), []], - [$stdlib.core.toLiftableModuleType(http.Util, "@winglang/sdk/http", "Util"), []], [api.url, []], ], }); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/while.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/while.test.w_compile_tf-aws.md index 710be6ffecd..d380f7b9611 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/while.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/while.test.w_compile_tf-aws.md @@ -31,9 +31,6 @@ const $extern = $helpers.createExternRequire(__dirname); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; while (false) { const x = 1; } diff --git a/tools/hangar/__snapshots__/test_corpus/valid/while_loop_await.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/while_loop_await.test.w_compile_tf-aws.md index b86de064c41..536b86d5155 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/while_loop_await.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/while_loop_await.test.w_compile_tf-aws.md @@ -189,13 +189,10 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const cloud = $stdlib.cloud; class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.nodeof(this).root.$preflightTypesMap = { }; - let $preflightTypesMap = {}; - const cloud = $stdlib.cloud; - $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; class $Closure1 extends $stdlib.std.AutoIdResource { _id = $stdlib.core.closureId(); constructor($scope, $id, ) {