コード例 #1
0
def test_transform_module_with_exports():
    _assert_transform(
        cc.module([
            cc.declare("__all__"),
            cc.declare("x"),
            cc.assign(cc.ref("__all__"), cc.list_literal([cc.str_literal("x")])),
            cc.assign(cc.ref("x"), cc.none)
        ], exported_names=["x"]),
        """
            var __all__;
            var x;
            __all__ = ["x"];
            x = null;
            $exports.x = x;
        """
    )
コード例 #2
0
def test_transform_string_expression():
    _assert_transform(
        cc.str_literal("hello"),
        js.string("hello")
    )
コード例 #3
0
ファイル: desugar_tests.py プロジェクト: mwilliamson/nope
 def test_transform(self):
     _assert_transform(
         nodes.str_literal("Many places I have been"),
         cc.str_literal("Many places I have been")
     )