From 62f0b2edce0e5dab2de558325959d4983116f54a Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Wed, 3 Jan 2024 14:57:50 -0500 Subject: [PATCH] remove transform --- .../vscode-wing/syntaxes/wing.tmLanguage.json | 2 +- docs/docs/07-examples/80-singletons.md | 2 +- libs/wingc/src/closure_transform.rs | 14 ++-- ...methods_and_properties_on_collections.snap | 2 +- .../access_property_on_primitive.snap | 2 +- ...rty_on_value_returned_from_collection.snap | 2 +- libs/wingc/src/jsify/snapshots/builtins.snap | 2 +- .../calls_methods_on_preflight_object.snap | 2 +- ...pture_from_inside_an_inflight_closure.snap | 2 +- ...entifier_closure_from_preflight_scope.snap | 4 +- ...pture_identifier_from_preflight_scope.snap | 2 +- ...from_preflight_scope_with_method_call.snap | 2 +- ...om_preflight_scope_with_nested_object.snap | 2 +- ...er_from_preflight_scope_with_property.snap | 2 +- .../snapshots/capture_in_keyword_args.snap | 2 +- .../capture_object_with_this_in_name.snap | 2 +- .../src/jsify/snapshots/capture_token.snap | 2 +- ...type_inflight_class_sibling_from_init.snap | 2 +- ...pe_inflight_class_sibling_from_method.snap | 2 +- ...e_new_inflight_class_inner_no_capture.snap | 2 +- ...capture_type_new_inflight_class_outer.snap | 2 +- .../snapshots/capture_type_static_method.snap | 2 +- ...ure_type_static_method_inflight_class.snap | 2 +- .../capture_var_from_method_inflight.snap | 2 +- ...ht_class_extends_outer_inflight_class.snap | 2 +- .../src/jsify/snapshots/closure_field.snap | 4 +- .../wingc/src/jsify/snapshots/enum_value.snap | 2 +- .../free_inflight_obj_from_inflight.snap | 2 +- .../jsify/snapshots/func_returns_func.snap | 2 +- .../src/jsify/snapshots/indirect_capture.snap | 2 +- ..._extends_both_inside_inflight_closure.snap | 2 +- .../snapshots/inline_inflight_class.snap | 2 +- .../src/jsify/snapshots/json_object.snap | 2 +- ...ary_preflight_and_inflight_expression.snap | 2 +- .../lift_binary_preflight_expression.snap | 2 +- ...ft_element_from_collection_of_objects.snap | 2 +- .../snapshots/lift_inflight_closure.snap | 4 +- .../lift_inside_preflight_method.snap | 2 +- .../src/jsify/snapshots/lift_string.snap | 2 +- libs/wingc/src/jsify/snapshots/lift_this.snap | 2 +- .../jsify/snapshots/lift_var_with_this.snap | 2 +- .../src/jsify/snapshots/lift_via_closure.snap | 4 +- .../lift_via_closure_class_explicit.snap | 2 +- .../namespaced_static_from_inflight.snap | 2 +- ...ed_inflight_after_preflight_operation.snap | 2 +- .../snapshots/nested_preflight_operation.snap | 2 +- .../jsify/snapshots/new_inflight_object.snap | 2 +- .../snapshots/no_capture_inside_methods.snap | 2 +- ...apture_of_identifier_from_inner_scope.snap | 2 +- ...capture_of_identifier_from_same_scope.snap | 2 +- ...no_capture_shadow_inside_inner_scopes.snap | 2 +- .../no_lift_shadow_inside_inner_scopes.snap | 2 +- .../jsify/snapshots/preflight_collection.snap | 2 +- ...light_collection_of_preflight_objects.snap | 2 +- ...eflight_nested_object_with_operations.snap | 2 +- .../src/jsify/snapshots/preflight_object.snap | 2 +- .../preflight_object_through_property.snap | 2 +- .../preflight_object_with_operations.snap | 2 +- .../snapshots/preflight_value_field.snap | 2 +- .../jsify/snapshots/read_primitive_value.snap | 2 +- .../snapshots/reassign_captured_variable.snap | 2 +- .../src/jsify/snapshots/ref_std_macro.snap | 2 +- .../snapshots/reference_inflight_class.snap | 2 +- .../reference_inflight_from_inflight.snap | 2 +- .../reference_lift_of_collection.snap | 2 +- .../snapshots/reference_static_inflight.snap | 2 +- ...ght_which_references_preflight_object.snap | 2 +- .../static_external_inflight_class.snap | 2 +- .../static_external_preflight_class.snap | 2 +- .../snapshots/static_inflight_operation.snap | 2 +- .../static_local_inflight_class.snap | 2 +- .../jsify/snapshots/static_on_std_type.snap | 2 +- .../jsify/snapshots/transitive_reference.snap | 2 +- ...ansitive_reference_via_inflight_class.snap | 2 +- .../transitive_reference_via_static.snap | 2 +- .../jsify/snapshots/two_identical_lifts.snap | 2 +- .../jsify/snapshots/use_util_functions.snap | 2 +- libs/wingc/src/jsify/snapshots/wait_util.snap | 2 +- libs/wingc/src/lib.rs | 11 +-- libs/wingc/src/nodeof_transform.rs | 77 ------------------- libs/wingc/src/parser.rs | 6 -- libs/wingsdk/src/helpers.ts | 6 ++ .../valid/assert.test.w_compile_tf-aws.md | 12 +-- .../bring_local.test.w_compile_tf-aws.md | 2 +- .../bring_projen.test.w_compile_tf-aws.md | 2 +- .../valid/debug_env.test.w_test_sim.md | 2 +- .../deep_equality.test.w_compile_tf-aws.md | 24 +++--- ...ing_interpolation.test.w_compile_tf-aws.md | 4 +- .../valid/nil.test.w_compile_tf-aws.md | 2 +- .../valid/optionals.test.w_compile_tf-aws.md | 2 +- .../valid/redis.test.w_compile_tf-aws.md | 2 +- 91 files changed, 120 insertions(+), 208 deletions(-) delete mode 100644 libs/wingc/src/nodeof_transform.rs diff --git a/apps/vscode-wing/syntaxes/wing.tmLanguage.json b/apps/vscode-wing/syntaxes/wing.tmLanguage.json index 027e5aab0ec..119c5e26e6f 100644 --- a/apps/vscode-wing/syntaxes/wing.tmLanguage.json +++ b/apps/vscode-wing/syntaxes/wing.tmLanguage.json @@ -129,7 +129,7 @@ }, { "name": "support.function.wing", - "match": "\\b(log|assert|unsafeCast|nodeof)\\b" + "match": "\\b(log|assert|throw|panic)\\b" } ] }, diff --git a/docs/docs/07-examples/80-singletons.md b/docs/docs/07-examples/80-singletons.md index b570449edbf..200f6525cba 100644 --- a/docs/docs/07-examples/80-singletons.md +++ b/docs/docs/07-examples/80-singletons.md @@ -23,7 +23,7 @@ class SingletonBucket { } ``` -The `SingletonBucket.of()` static method uses `nodeof(scope).root` to find the root node of the app. +The `SingletonBucket.of()` static method uses `std.Node.of(scope).root` to find the root node of the app. Then, if there is already a child with the identifier `SingletonBucket` at that level, it returns it or otherwise it creates a new bucket with this id (`as uid`) under the root node (`in root`). diff --git a/libs/wingc/src/closure_transform.rs b/libs/wingc/src/closure_transform.rs index f27635ce64a..dc9b089f653 100644 --- a/libs/wingc/src/closure_transform.rs +++ b/libs/wingc/src/closure_transform.rs @@ -185,19 +185,15 @@ impl Fold for ClosureTransformer { // class_init_body := // ``` - // std.Node.of(this).hidden = true; + // nodeof(this).hidden = true; // ``` let std_display_of_this = Expr::new( ExprKind::Call { callee: CalleeKind::Expr(Box::new(Expr::new( - ExprKind::Reference(Reference::TypeMember { - type_name: UserDefinedType { - root: Symbol::new("std", WingSpan::for_file(file_id)), - fields: vec![Symbol::new("Node", WingSpan::for_file(file_id))], - span: WingSpan::for_file(file_id), - }, - property: Symbol::new("of", WingSpan::for_file(file_id)), - }), + ExprKind::Reference(Reference::Identifier(Symbol::new( + "nodeof", + WingSpan::for_file(file_id), + ))), WingSpan::for_file(file_id), ))), arg_list: ArgList { 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 c84fdc02332..41ce2e3bffb 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 @@ -54,7 +54,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 dc945d885a5..3aa2ec01512 100644 --- a/libs/wingc/src/jsify/snapshots/access_property_on_primitive.snap +++ b/libs/wingc/src/jsify/snapshots/access_property_on_primitive.snap @@ -51,7 +51,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 ac650f110e3..8fd5607440b 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 @@ -51,7 +51,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/builtins.snap b/libs/wingc/src/jsify/snapshots/builtins.snap index 07ec146266c..1b23f98635f 100644 --- a/libs/wingc/src/jsify/snapshots/builtins.snap +++ b/libs/wingc/src/jsify/snapshots/builtins.snap @@ -49,7 +49,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 5baf8ad2b5b..7028cf7d46c 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 @@ -55,7 +55,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 77e59c01119..ebe914d42c3 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 @@ -55,7 +55,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 30f0792a04a..6afcd76880a 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 @@ -70,7 +70,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` @@ -97,7 +97,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 91d898b1b8c..43f6536b6ff 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 @@ -50,7 +50,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 782233237f9..c38fa4e4bc1 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 @@ -96,7 +96,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 ec13170bbce..0452412145e 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 @@ -101,7 +101,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 62f4bf6d2a4..0ef301a974c 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 @@ -50,7 +50,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 55ed7c2791b..25a2adf2830 100644 --- a/libs/wingc/src/jsify/snapshots/capture_in_keyword_args.snap +++ b/libs/wingc/src/jsify/snapshots/capture_in_keyword_args.snap @@ -56,7 +56,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 667bbd06312..4eb375af7e2 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 @@ -52,7 +52,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/capture_token.snap b/libs/wingc/src/jsify/snapshots/capture_token.snap index f8a9ce2ad81..45cd60aeeec 100644 --- a/libs/wingc/src/jsify/snapshots/capture_token.snap +++ b/libs/wingc/src/jsify/snapshots/capture_token.snap @@ -51,7 +51,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 54cc08f9ea7..7079c2f2694 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 @@ -74,7 +74,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 1ac1862b6da..8d4294db633 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 @@ -60,7 +60,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 8c0e0491b44..bbf074e3386 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 @@ -52,7 +52,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 a5b6e57d323..eb60934c778 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 @@ -89,7 +89,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 cb4a8b31189..14ac1fdb65a 100644 --- a/libs/wingc/src/jsify/snapshots/capture_type_static_method.snap +++ b/libs/wingc/src/jsify/snapshots/capture_type_static_method.snap @@ -96,7 +96,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 29db974a47e..f6ed1e538fc 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 @@ -94,7 +94,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 437c8e3d1c1..b9864a0db6e 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 @@ -57,7 +57,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 a37958193b9..a97d5231279 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 @@ -92,7 +92,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/closure_field.snap b/libs/wingc/src/jsify/snapshots/closure_field.snap index 1d9951517fc..fc8f3502113 100644 --- a/libs/wingc/src/jsify/snapshots/closure_field.snap +++ b/libs/wingc/src/jsify/snapshots/closure_field.snap @@ -117,7 +117,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` @@ -184,7 +184,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/enum_value.snap b/libs/wingc/src/jsify/snapshots/enum_value.snap index e07badde6f6..8142e9ccb2b 100644 --- a/libs/wingc/src/jsify/snapshots/enum_value.snap +++ b/libs/wingc/src/jsify/snapshots/enum_value.snap @@ -54,7 +54,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 1b17c1910d5..eb5148e95e3 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 @@ -62,7 +62,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/func_returns_func.snap b/libs/wingc/src/jsify/snapshots/func_returns_func.snap index ea426b3aa71..34c05c7ced8 100644 --- a/libs/wingc/src/jsify/snapshots/func_returns_func.snap +++ b/libs/wingc/src/jsify/snapshots/func_returns_func.snap @@ -59,7 +59,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/indirect_capture.snap b/libs/wingc/src/jsify/snapshots/indirect_capture.snap index 0104b32d33d..42f7990d964 100644 --- a/libs/wingc/src/jsify/snapshots/indirect_capture.snap +++ b/libs/wingc/src/jsify/snapshots/indirect_capture.snap @@ -124,7 +124,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 2dfc6573d83..30c6dce5264 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 @@ -53,7 +53,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/inline_inflight_class.snap b/libs/wingc/src/jsify/snapshots/inline_inflight_class.snap index 4c98354b3f1..8ec17f29248 100644 --- a/libs/wingc/src/jsify/snapshots/inline_inflight_class.snap +++ b/libs/wingc/src/jsify/snapshots/inline_inflight_class.snap @@ -82,7 +82,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/json_object.snap b/libs/wingc/src/jsify/snapshots/json_object.snap index 5bd8bce7dda..1edf0c18f9b 100644 --- a/libs/wingc/src/jsify/snapshots/json_object.snap +++ b/libs/wingc/src/jsify/snapshots/json_object.snap @@ -51,7 +51,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 9fe1171026c..4ea7c9e3431 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 @@ -52,7 +52,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 5948c9984b8..4f7bf64cd99 100644 --- a/libs/wingc/src/jsify/snapshots/lift_binary_preflight_expression.snap +++ b/libs/wingc/src/jsify/snapshots/lift_binary_preflight_expression.snap @@ -51,7 +51,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 1e39aaa2d21..a0791351397 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 @@ -53,7 +53,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/lift_inflight_closure.snap b/libs/wingc/src/jsify/snapshots/lift_inflight_closure.snap index 9fa8275cfe7..be8c1693586 100644 --- a/libs/wingc/src/jsify/snapshots/lift_inflight_closure.snap +++ b/libs/wingc/src/jsify/snapshots/lift_inflight_closure.snap @@ -71,7 +71,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` @@ -98,7 +98,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 31cb53c3663..75e55f1f491 100644 --- a/libs/wingc/src/jsify/snapshots/lift_inside_preflight_method.snap +++ b/libs/wingc/src/jsify/snapshots/lift_inside_preflight_method.snap @@ -86,7 +86,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/lift_string.snap b/libs/wingc/src/jsify/snapshots/lift_string.snap index c024831ddb0..81b846bc364 100644 --- a/libs/wingc/src/jsify/snapshots/lift_string.snap +++ b/libs/wingc/src/jsify/snapshots/lift_string.snap @@ -50,7 +50,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/lift_this.snap b/libs/wingc/src/jsify/snapshots/lift_this.snap index 1f98631ba7f..496aa616021 100644 --- a/libs/wingc/src/jsify/snapshots/lift_this.snap +++ b/libs/wingc/src/jsify/snapshots/lift_this.snap @@ -119,7 +119,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 21946f22a06..5536097f59b 100644 --- a/libs/wingc/src/jsify/snapshots/lift_var_with_this.snap +++ b/libs/wingc/src/jsify/snapshots/lift_var_with_this.snap @@ -97,7 +97,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/lift_via_closure.snap b/libs/wingc/src/jsify/snapshots/lift_via_closure.snap index 5f66b6663e9..fff768773f4 100644 --- a/libs/wingc/src/jsify/snapshots/lift_via_closure.snap +++ b/libs/wingc/src/jsify/snapshots/lift_via_closure.snap @@ -79,7 +79,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` @@ -113,7 +113,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 bb0dc454d0f..9b20601aed6 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 @@ -134,7 +134,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 5dfd1136279..09c1abd9dd6 100644 --- a/libs/wingc/src/jsify/snapshots/namespaced_static_from_inflight.snap +++ b/libs/wingc/src/jsify/snapshots/namespaced_static_from_inflight.snap @@ -51,7 +51,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 49c3141c61c..16b3802af42 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 @@ -103,7 +103,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/nested_preflight_operation.snap b/libs/wingc/src/jsify/snapshots/nested_preflight_operation.snap index 597e03ce9ee..2d8e71df259 100644 --- a/libs/wingc/src/jsify/snapshots/nested_preflight_operation.snap +++ b/libs/wingc/src/jsify/snapshots/nested_preflight_operation.snap @@ -148,7 +148,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/new_inflight_object.snap b/libs/wingc/src/jsify/snapshots/new_inflight_object.snap index a9790c432de..704e2facafc 100644 --- a/libs/wingc/src/jsify/snapshots/new_inflight_object.snap +++ b/libs/wingc/src/jsify/snapshots/new_inflight_object.snap @@ -89,7 +89,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 dd8460ad6d6..c9da3b2a997 100644 --- a/libs/wingc/src/jsify/snapshots/no_capture_inside_methods.snap +++ b/libs/wingc/src/jsify/snapshots/no_capture_inside_methods.snap @@ -55,7 +55,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 013634342f7..0e7fd3600d7 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 @@ -55,7 +55,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 e93c67ade34..5f94ddcd987 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 @@ -51,7 +51,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 4afe6ba2c27..522554da085 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 @@ -63,7 +63,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 564da72a6cb..4f27731b783 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 @@ -61,7 +61,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/preflight_collection.snap b/libs/wingc/src/jsify/snapshots/preflight_collection.snap index e2f85696f41..fbb2db78cdd 100644 --- a/libs/wingc/src/jsify/snapshots/preflight_collection.snap +++ b/libs/wingc/src/jsify/snapshots/preflight_collection.snap @@ -52,7 +52,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 3df8a07051c..d071022b004 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 @@ -57,7 +57,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 298b891d89e..5a000e77290 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 @@ -101,7 +101,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/preflight_object.snap b/libs/wingc/src/jsify/snapshots/preflight_object.snap index 4c3a2110fc3..81933db2ec9 100644 --- a/libs/wingc/src/jsify/snapshots/preflight_object.snap +++ b/libs/wingc/src/jsify/snapshots/preflight_object.snap @@ -100,7 +100,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 484f050de93..dbc981fbe3e 100644 --- a/libs/wingc/src/jsify/snapshots/preflight_object_through_property.snap +++ b/libs/wingc/src/jsify/snapshots/preflight_object_through_property.snap @@ -102,7 +102,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 12c98a6ea69..00c7caa3df8 100644 --- a/libs/wingc/src/jsify/snapshots/preflight_object_with_operations.snap +++ b/libs/wingc/src/jsify/snapshots/preflight_object_with_operations.snap @@ -54,7 +54,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/preflight_value_field.snap b/libs/wingc/src/jsify/snapshots/preflight_value_field.snap index a2aa5f0ee2a..7cd709052db 100644 --- a/libs/wingc/src/jsify/snapshots/preflight_value_field.snap +++ b/libs/wingc/src/jsify/snapshots/preflight_value_field.snap @@ -107,7 +107,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/read_primitive_value.snap b/libs/wingc/src/jsify/snapshots/read_primitive_value.snap index 085bd427210..9b0ffc3f8cb 100644 --- a/libs/wingc/src/jsify/snapshots/read_primitive_value.snap +++ b/libs/wingc/src/jsify/snapshots/read_primitive_value.snap @@ -51,7 +51,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/reassign_captured_variable.snap b/libs/wingc/src/jsify/snapshots/reassign_captured_variable.snap index aa4c0c4a593..ce16022c1d5 100644 --- a/libs/wingc/src/jsify/snapshots/reassign_captured_variable.snap +++ b/libs/wingc/src/jsify/snapshots/reassign_captured_variable.snap @@ -60,7 +60,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/ref_std_macro.snap b/libs/wingc/src/jsify/snapshots/ref_std_macro.snap index ae08a085072..4c5b2e1950c 100644 --- a/libs/wingc/src/jsify/snapshots/ref_std_macro.snap +++ b/libs/wingc/src/jsify/snapshots/ref_std_macro.snap @@ -51,7 +51,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/reference_inflight_class.snap b/libs/wingc/src/jsify/snapshots/reference_inflight_class.snap index a68571de380..9f2591caa0a 100644 --- a/libs/wingc/src/jsify/snapshots/reference_inflight_class.snap +++ b/libs/wingc/src/jsify/snapshots/reference_inflight_class.snap @@ -94,7 +94,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 d707dcb37c6..aea0e36bd37 100644 --- a/libs/wingc/src/jsify/snapshots/reference_inflight_from_inflight.snap +++ b/libs/wingc/src/jsify/snapshots/reference_inflight_from_inflight.snap @@ -113,7 +113,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 f7bfd403263..deaf9fc0537 100644 --- a/libs/wingc/src/jsify/snapshots/reference_lift_of_collection.snap +++ b/libs/wingc/src/jsify/snapshots/reference_lift_of_collection.snap @@ -51,7 +51,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/reference_static_inflight.snap b/libs/wingc/src/jsify/snapshots/reference_static_inflight.snap index d28bfa9480b..5797f4afaf3 100644 --- a/libs/wingc/src/jsify/snapshots/reference_static_inflight.snap +++ b/libs/wingc/src/jsify/snapshots/reference_static_inflight.snap @@ -96,7 +96,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 46eed0c2bcc..9303107fb78 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 @@ -112,7 +112,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 f6ce75c5bc7..34c32615f19 100644 --- a/libs/wingc/src/jsify/snapshots/static_external_inflight_class.snap +++ b/libs/wingc/src/jsify/snapshots/static_external_inflight_class.snap @@ -105,7 +105,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 d8034fcbc47..71b5ad4cef6 100644 --- a/libs/wingc/src/jsify/snapshots/static_external_preflight_class.snap +++ b/libs/wingc/src/jsify/snapshots/static_external_preflight_class.snap @@ -104,7 +104,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/static_inflight_operation.snap b/libs/wingc/src/jsify/snapshots/static_inflight_operation.snap index 357c5e42db0..7cd23a807fc 100644 --- a/libs/wingc/src/jsify/snapshots/static_inflight_operation.snap +++ b/libs/wingc/src/jsify/snapshots/static_inflight_operation.snap @@ -109,7 +109,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 d0e1b033f4f..8473202f2df 100644 --- a/libs/wingc/src/jsify/snapshots/static_local_inflight_class.snap +++ b/libs/wingc/src/jsify/snapshots/static_local_inflight_class.snap @@ -71,7 +71,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 1552037a8d5..75d3b27070a 100644 --- a/libs/wingc/src/jsify/snapshots/static_on_std_type.snap +++ b/libs/wingc/src/jsify/snapshots/static_on_std_type.snap @@ -51,7 +51,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/transitive_reference.snap b/libs/wingc/src/jsify/snapshots/transitive_reference.snap index 3c4813911ee..9fbfd4ca3ff 100644 --- a/libs/wingc/src/jsify/snapshots/transitive_reference.snap +++ b/libs/wingc/src/jsify/snapshots/transitive_reference.snap @@ -134,7 +134,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 72ae02fe3bd..cb2e15952ed 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 @@ -110,7 +110,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` 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 a9204bb6455..d3d2a10683d 100644 --- a/libs/wingc/src/jsify/snapshots/transitive_reference_via_static.snap +++ b/libs/wingc/src/jsify/snapshots/transitive_reference_via_static.snap @@ -167,7 +167,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/two_identical_lifts.snap b/libs/wingc/src/jsify/snapshots/two_identical_lifts.snap index a441b0e6358..47ee7b6f507 100644 --- a/libs/wingc/src/jsify/snapshots/two_identical_lifts.snap +++ b/libs/wingc/src/jsify/snapshots/two_identical_lifts.snap @@ -60,7 +60,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/use_util_functions.snap b/libs/wingc/src/jsify/snapshots/use_util_functions.snap index b634871201f..5133765405a 100644 --- a/libs/wingc/src/jsify/snapshots/use_util_functions.snap +++ b/libs/wingc/src/jsify/snapshots/use_util_functions.snap @@ -50,7 +50,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/jsify/snapshots/wait_util.snap b/libs/wingc/src/jsify/snapshots/wait_util.snap index c498cdb909d..2b82de24b1e 100644 --- a/libs/wingc/src/jsify/snapshots/wait_util.snap +++ b/libs/wingc/src/jsify/snapshots/wait_util.snap @@ -57,7 +57,7 @@ class $Root extends $stdlib.std.Resource { _hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex'); constructor($scope, $id, ) { super($scope, $id); - (std.Node.of(this)).hidden = true; + $helpers.nodeof(this).hidden = true; } static _toInflightType() { return ` diff --git a/libs/wingc/src/lib.rs b/libs/wingc/src/lib.rs index 7574f678c86..2c712075931 100644 --- a/libs/wingc/src/lib.rs +++ b/libs/wingc/src/lib.rs @@ -58,7 +58,6 @@ pub mod jsify; pub mod json_schema_generator; mod lifting; pub mod lsp; -pub mod nodeof_transform; pub mod parser; pub mod struct_schema; pub mod type_check; @@ -294,10 +293,8 @@ pub fn type_check( .0 .as_type() .expect("std.Node was found but it's not a type"); - add_builtin( UtilityFunctions::Nodeof.to_string().as_str(), - // important: the function type must be the same as std.Node.of Type::Function(FunctionSignature { this_type: None, parameters: vec![FunctionParameter { @@ -308,7 +305,7 @@ pub fn type_check( }], return_type: std_node, phase: Phase::Preflight, - js_override: None, // implementation replaced by nodeof_transform + js_override: Some("$helpers.nodeof($args$)".to_string()), docs: Docs::with_summary("Obtain the tree node of a preflight resource."), }), scope, @@ -358,16 +355,12 @@ pub fn compile( // -- DESUGARING PHASE -- + // Transform all inflight closures defined in preflight into single-method resources let mut asts = asts .into_iter() .map(|(path, scope)| { - // Transform all inflight closures defined in preflight into single-method resources let mut inflight_transformer = ClosureTransformer::new(); let scope = inflight_transformer.fold_scope(scope); - - // Transform `nodeof` calls into `std.Node.of` calls - let mut nodeof_transformer = nodeof_transform::NodeofTransformer::new(); - let scope = nodeof_transformer.fold_scope(scope); (path, scope) }) .collect::>(); diff --git a/libs/wingc/src/nodeof_transform.rs b/libs/wingc/src/nodeof_transform.rs deleted file mode 100644 index 4c8c1ef5a8c..00000000000 --- a/libs/wingc/src/nodeof_transform.rs +++ /dev/null @@ -1,77 +0,0 @@ -use crate::{ - ast::{CalleeKind, Expr, ExprKind, Reference, Symbol, UserDefinedType}, - diagnostic::WingSpan, - fold::{self, Fold}, -}; - -/// Transforms `nodeof(x)` expressions into `std.Node.of(x)` -pub struct NodeofTransformer; - -impl NodeofTransformer { - pub fn new() -> Self { - Self - } -} - -impl Fold for NodeofTransformer { - fn fold_expr(&mut self, expr: Expr) -> Expr { - let file_id = &expr.span.file_id; - - let ExprKind::Call { callee, arg_list } = expr.kind else { - return fold::fold_expr(self, expr); - }; - - let arg_list = self.fold_args(arg_list); - - let callee = match callee { - CalleeKind::Expr(call_expr) => call_expr, - _ => { - return Expr { - kind: ExprKind::Call { callee, arg_list }, - id: expr.id, - span: expr.span, - }; - } - }; - - let ExprKind::Reference(Reference::Identifier(Symbol { ref name, .. })) = callee.kind else { - return Expr { - kind: ExprKind::Call { - callee: CalleeKind::Expr(callee), - arg_list, - }, - id: expr.id, - span: expr.span, - }; - }; - - if name != "nodeof" { - return Expr { - kind: ExprKind::Call { - callee: CalleeKind::Expr(callee), - arg_list, - }, - id: expr.id, - span: expr.span, - }; - } - - Expr::new( - ExprKind::Call { - callee: CalleeKind::Expr(Box::new(Expr::new( - ExprKind::Reference(Reference::TypeMember { - type_name: UserDefinedType { - root: Symbol::new("std", WingSpan::for_file(file_id)), - fields: vec![Symbol::new("Node", WingSpan::for_file(file_id))], - span: WingSpan::for_file(file_id), - }, - property: Symbol::new("of", WingSpan::for_file(file_id)), - }), - WingSpan::for_file(file_id), - ))), - arg_list, - }, - WingSpan::for_file(file_id), - ) - } -} diff --git a/libs/wingc/src/parser.rs b/libs/wingc/src/parser.rs index 9f2bb6a7b7a..6eb33b60cb0 100644 --- a/libs/wingc/src/parser.rs +++ b/libs/wingc/src/parser.rs @@ -129,12 +129,6 @@ static RESERVED_WORDS: phf::Set<&'static str> = phf_set! { "Array", "MutArray", - // wing global functions - "log", - "assert", - "unsafeCast", - "nodeof", - // nodejs globals used in emitted code "require", "module", diff --git a/libs/wingsdk/src/helpers.ts b/libs/wingsdk/src/helpers.ts index 7cf0181ab60..99b33d89ef7 100644 --- a/libs/wingsdk/src/helpers.ts +++ b/libs/wingsdk/src/helpers.ts @@ -1,6 +1,8 @@ // Code in this file will be automatically included in all inflight code bundles, // so avoid importing anything heavy here. import { deepStrictEqual, notDeepStrictEqual } from "node:assert"; +import type { Construct } from "constructs"; +import { Node } from "./std/node"; export function eq(a: any, b: any): boolean { try { @@ -35,3 +37,7 @@ export function range(start: number, end: number, inclusive: boolean) { } return iterator(); } + +export function nodeof(construct: Construct): Node { + return Node.of(construct); +} 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 220f0c30277..e88850badb0 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 @@ -20,11 +20,11 @@ module.exports = function({ $s1, $s2 }) { $helpers.assert($helpers.eq("`s1`", "`s1`"), "\"`s1`\" == \"`s1`\""); $helpers.assert($helpers.eq($s1, $s1), "s1 == s1"); $helpers.assert($helpers.eq(String.raw({ raw: ["", ""] }, $s1), String.raw({ raw: ["", ""] }, $s1)), "\"{s1}\" == \"{s1}\""); - $helpers.assert($helpers.neq(String.raw({ raw: ["", ""] }, $s1), String.raw({ raw: ["", ""] }, $s2)), "\"{s1}\" != \"{s2}\""); + $helpers.assert(!$helpers.eq(String.raw({ raw: ["", ""] }, $s1), String.raw({ raw: ["", ""] }, $s2)), "\"{s1}\" != \"{s2}\""); $helpers.assert($helpers.eq(String.raw({ raw: ["a", ""] }, $s1), String.raw({ raw: ["a", ""] }, $s1)), "\"a{s1}\" == \"a{s1}\""); - $helpers.assert($helpers.neq(String.raw({ raw: ["a", ""] }, $s1), String.raw({ raw: ["b", ""] }, $s1)), "\"a{s1}\" != \"b{s1}\""); + $helpers.assert(!$helpers.eq(String.raw({ raw: ["a", ""] }, $s1), String.raw({ raw: ["b", ""] }, $s1)), "\"a{s1}\" != \"b{s1}\""); $helpers.assert($helpers.eq(String.raw({ raw: ["", "a"] }, $s1), String.raw({ raw: ["", "a"] }, $s1)), "\"{s1}a\" == \"{s1}a\""); - $helpers.assert($helpers.neq(String.raw({ raw: ["", "a"] }, $s1), String.raw({ raw: ["", "b"] }, $s1)), "\"{s1}a\" != \"{s1}b\""); + $helpers.assert(!$helpers.eq(String.raw({ raw: ["", "a"] }, $s1), String.raw({ raw: ["", "b"] }, $s1)), "\"{s1}a\" != \"{s1}b\""); $helpers.assert($helpers.eq(String.raw({ raw: ["`'", ""] }, $s1), String.raw({ raw: ["`'", ""] }, $s1)), "\"`\'{s1}\" == \"`\'{s1}\""); $helpers.assert($helpers.eq(String.raw({ raw: ["a", "b", "c"] }, $s1, $s2), String.raw({ raw: ["a", "b", "c"] }, $s1, $s2)), "\"a{s1}b{s2}c\" == \"a{s1}b{s2}c\""); } @@ -111,11 +111,11 @@ class $Root extends $stdlib.std.Resource { $helpers.assert($helpers.eq("`s1`", "`s1`"), "\"`s1`\" == \"`s1`\""); $helpers.assert($helpers.eq(s1, s1), "s1 == s1"); $helpers.assert($helpers.eq(String.raw({ raw: ["", ""] }, s1), String.raw({ raw: ["", ""] }, s1)), "\"{s1}\" == \"{s1}\""); - $helpers.assert($helpers.neq(String.raw({ raw: ["", ""] }, s1), String.raw({ raw: ["", ""] }, s2)), "\"{s1}\" != \"{s2}\""); + $helpers.assert(!$helpers.eq(String.raw({ raw: ["", ""] }, s1), String.raw({ raw: ["", ""] }, s2)), "\"{s1}\" != \"{s2}\""); $helpers.assert($helpers.eq(String.raw({ raw: ["a", ""] }, s1), String.raw({ raw: ["a", ""] }, s1)), "\"a{s1}\" == \"a{s1}\""); - $helpers.assert($helpers.neq(String.raw({ raw: ["a", ""] }, s1), String.raw({ raw: ["b", ""] }, s1)), "\"a{s1}\" != \"b{s1}\""); + $helpers.assert(!$helpers.eq(String.raw({ raw: ["a", ""] }, s1), String.raw({ raw: ["b", ""] }, s1)), "\"a{s1}\" != \"b{s1}\""); $helpers.assert($helpers.eq(String.raw({ raw: ["", "a"] }, s1), String.raw({ raw: ["", "a"] }, s1)), "\"{s1}a\" == \"{s1}a\""); - $helpers.assert($helpers.neq(String.raw({ raw: ["", "a"] }, s1), String.raw({ raw: ["", "b"] }, s1)), "\"{s1}a\" != \"{s1}b\""); + $helpers.assert(!$helpers.eq(String.raw({ raw: ["", "a"] }, s1), String.raw({ raw: ["", "b"] }, s1)), "\"{s1}a\" != \"{s1}b\""); $helpers.assert($helpers.eq(String.raw({ raw: ["`'", ""] }, s1), String.raw({ raw: ["`'", ""] }, s1)), "\"`\'{s1}\" == \"`\'{s1}\""); $helpers.assert($helpers.eq(String.raw({ raw: ["a", "b", "c"] }, s1, s2), String.raw({ raw: ["a", "b", "c"] }, s1, s2)), "\"a{s1}b{s2}c\" == \"a{s1}b{s2}c\""); this.node.root.new("@winglang/sdk.std.Test", std.Test, this, "test:assert works inflight", new $Closure1(this, "$Closure1")); 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 ec09fe5b1e8..8ebcfa135cc 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 @@ -386,7 +386,7 @@ class $Root extends $stdlib.std.Resource { this.node.root.new("@winglang/sdk.std.Test", std.Test, this, "test:add data to store", new $Closure1(this, "$Closure1")); const s = ({"x": 1, "y": 2}); const c = file1.Color.BLUE; - $helpers.assert($helpers.neq(c, file1.Color.RED), "c != file1.Color.RED"); + $helpers.assert(!$helpers.eq(c, file1.Color.RED), "c != file1.Color.RED"); const t = new Triangle(this, "Triangle"); } } 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 43ac8124853..3e01a0c1c15 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 @@ -32,7 +32,7 @@ const projen = require("projen"); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { super($scope, $id); - $helpers.assert($helpers.neq(projen.LogLevel.OFF, projen.LogLevel.VERBOSE), "projen.LogLevel.OFF != projen.LogLevel.VERBOSE"); + $helpers.assert(!$helpers.eq(projen.LogLevel.OFF, projen.LogLevel.VERBOSE), "projen.LogLevel.OFF != projen.LogLevel.VERBOSE"); } } const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/debug_env.test.w_test_sim.md b/tools/hangar/__snapshots__/test_corpus/valid/debug_env.test.w_test_sim.md index 33823613a5d..dfc5e12e7bf 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/debug_env.test.w_test_sim.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/debug_env.test.w_test_sim.md @@ -4,7 +4,7 @@ ```log [symbol environment at debug_env.test.w:7:5] level 0: { this => A } -level 1: { A => A [type], assert => (condition: bool): void, cloud => cloud [namespace], log => (message: str): void, nodeof => preflight (construct: IConstruct): Node, std => std [namespace], unsafeCast => (value: any): any } +level 1: { A => A [type], assert => (condition: bool): void, cloud => cloud [namespace], log => (message: str): void, std => std [namespace], unsafeCast => (value: any): any } ``` ## stdout.log 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 0181f5302b1..dc11423eda5 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 @@ -35,8 +35,8 @@ module.exports = function({ $arrayA, $arrayB, $arrayC }) { return $obj; } async handle() { - $helpers.assert($helpers.neq($arrayA, $arrayC), "arrayA != arrayC"); - $helpers.assert((!$helpers.neq($arrayA, $arrayB)), "!(arrayA != arrayB)"); + $helpers.assert(!$helpers.eq($arrayA, $arrayC), "arrayA != arrayC"); + $helpers.assert((!!$helpers.eq($arrayA, $arrayB)), "!(arrayA != arrayB)"); } } return $Closure10; @@ -77,8 +77,8 @@ module.exports = function({ $cat1, $cat2, $cat3 }) { return $obj; } async handle() { - $helpers.assert($helpers.neq($cat1, $cat3), "cat1 != cat3"); - $helpers.assert((!$helpers.neq($cat1, $cat2)), "!(cat1 != cat2)"); + $helpers.assert(!$helpers.eq($cat1, $cat3), "cat1 != cat3"); + $helpers.assert((!!$helpers.eq($cat1, $cat2)), "!(cat1 != cat2)"); } } return $Closure12; @@ -98,8 +98,8 @@ module.exports = function({ $numA, $numC, $strA, $strC }) { return $obj; } async handle() { - $helpers.assert($helpers.neq($numA, $numC), "numA != numC"); - $helpers.assert($helpers.neq($strA, $strC), "strA != strC"); + $helpers.assert(!$helpers.eq($numA, $numC), "numA != numC"); + $helpers.assert(!$helpers.eq($strA, $strC), "strA != strC"); } } return $Closure2; @@ -140,8 +140,8 @@ module.exports = function({ $jsonA, $jsonB, $jsonC }) { return $obj; } async handle() { - $helpers.assert($helpers.neq($jsonA, $jsonC), "jsonA != jsonC"); - $helpers.assert((!$helpers.neq($jsonA, $jsonB)), "!(jsonA != jsonB)"); + $helpers.assert(!$helpers.eq($jsonA, $jsonC), "jsonA != jsonC"); + $helpers.assert((!!$helpers.eq($jsonA, $jsonB)), "!(jsonA != jsonB)"); } } return $Closure4; @@ -182,8 +182,8 @@ module.exports = function({ $setA, $setB, $setC }) { return $obj; } async handle() { - $helpers.assert($helpers.neq($setA, $setC), "setA != setC"); - $helpers.assert((!$helpers.neq($setA, $setB)), "!(setA != setB)"); + $helpers.assert(!$helpers.eq($setA, $setC), "setA != setC"); + $helpers.assert((!!$helpers.eq($setA, $setB)), "!(setA != setB)"); } } return $Closure6; @@ -224,8 +224,8 @@ module.exports = function({ $mapA, $mapB, $mapC }) { return $obj; } async handle() { - $helpers.assert($helpers.neq($mapA, $mapC), "mapA != mapC"); - $helpers.assert((!$helpers.neq($mapA, $mapB)), "!(mapA != mapB)"); + $helpers.assert(!$helpers.eq($mapA, $mapC), "mapA != mapC"); + $helpers.assert((!!$helpers.eq($mapA, $mapB)), "!(mapA != mapB)"); } } return $Closure8; 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 690849b8a4b..cd581e88c90 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 @@ -96,8 +96,8 @@ class $Root extends $stdlib.std.Resource { const endingWithCoolStrings = String.raw({ raw: ["cool -> ", " ", ""] }, regularString, number); $helpers.assert($helpers.eq(String.raw({ raw: ["", ""] }, (1 + 1)), "2"), "\"{1+1}\" == \"2\""); $helpers.assert($helpers.eq("{1+1}", "{1+1}"), "\"\\{1+1}\" == \"\\{1+1}\""); - $helpers.assert($helpers.neq("{1+1}", "2"), "\"\\{1+1}\" != \"2\""); - $helpers.assert($helpers.neq("{1+1}", "{2}"), "\"\\{1+1}\" != \"\\{2}\""); + $helpers.assert(!$helpers.eq("{1+1}", "2"), "\"\\{1+1}\" != \"2\""); + $helpers.assert(!$helpers.eq("{1+1}", "{2}"), "\"\\{1+1}\" != \"\\{2}\""); this.node.root.new("@winglang/sdk.std.Test", std.Test, this, "test:str interpolation with lifted expr", new $Closure1(this, "$Closure1")); } } 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 cfb0fdded70..3b20087c706 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 @@ -36,7 +36,7 @@ module.exports = function({ $foo }) { $helpers.assert($helpers.eq((((await $foo.getOptionalValue())) != null), false), "foo.getOptionalValue()? == false"); (await $foo.setOptionalValue("hello")); $helpers.assert($helpers.eq((((await $foo.getOptionalValue())) != null), true), "foo.getOptionalValue()? == true"); - $helpers.assert($helpers.neq((await $foo.getOptionalValue()), undefined), "foo.getOptionalValue() != nil"); + $helpers.assert(!$helpers.eq((await $foo.getOptionalValue()), undefined), "foo.getOptionalValue() != nil"); (await $foo.setOptionalValue(undefined)); $helpers.assert($helpers.eq((((await $foo.getOptionalValue())) != null), false), "foo.getOptionalValue()? == false"); $helpers.assert($helpers.eq((await $foo.getOptionalValue()), undefined), "foo.getOptionalValue() == nil"); 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 a7a2015685c..a6999efe1c1 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 @@ -375,7 +375,7 @@ class $Root extends $stdlib.std.Resource { if ($if_let_value != undefined) { const parsedName = $if_let_value; $helpers.assert($helpers.eq(parsedName.first, "BadName"), "parsedName.first == \"BadName\""); - if ($helpers.neq(parsedName.last, "")) { + if (!$helpers.eq(parsedName.last, "")) { $helpers.assert(false, "false"); } } 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 7d2ec065cf2..f9a2650de08 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 @@ -37,7 +37,7 @@ module.exports = function({ $queue, $r, $r2, $util_Util }) { $helpers.assert($helpers.eq(value2, "does redis again"), "value2 == \"does redis again\""); (await $queue.push("world!")); (await $util_Util.waitUntil(async () => { - return $helpers.neq((await $r.get("hello")), undefined); + return !$helpers.eq((await $r.get("hello")), undefined); })); $helpers.assert($helpers.eq("world!", String.raw({ raw: ["", ""] }, (await $r.get("hello")))), "\"world!\" == \"{r.get(\"hello\")}\""); }