@ugo-studio/jspp 0.2.9 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/core/codegen/class-handlers.js +6 -6
  2. package/dist/core/codegen/statement-handlers.js +1 -1
  3. package/package.json +1 -1
  4. package/src/prelude/any_value.hpp +362 -362
  5. package/src/prelude/any_value_access.hpp +170 -170
  6. package/src/prelude/any_value_defines.hpp +189 -189
  7. package/src/prelude/any_value_helpers.hpp +374 -374
  8. package/src/prelude/library/array.hpp +185 -185
  9. package/src/prelude/library/console.hpp +111 -111
  10. package/src/prelude/library/error.hpp +112 -112
  11. package/src/prelude/library/function.hpp +10 -10
  12. package/src/prelude/library/math.hpp +307 -307
  13. package/src/prelude/library/object.hpp +275 -275
  14. package/src/prelude/library/process.hpp +39 -39
  15. package/src/prelude/library/promise.hpp +123 -123
  16. package/src/prelude/library/symbol.hpp +52 -52
  17. package/src/prelude/library/timer.hpp +91 -91
  18. package/src/prelude/types.hpp +178 -178
  19. package/src/prelude/utils/access.hpp +411 -411
  20. package/src/prelude/utils/operators.hpp +336 -336
  21. package/src/prelude/values/array.hpp +0 -1
  22. package/src/prelude/values/async_iterator.hpp +83 -83
  23. package/src/prelude/values/function.hpp +82 -82
  24. package/src/prelude/values/helpers/array.hpp +198 -208
  25. package/src/prelude/values/helpers/async_iterator.hpp +275 -275
  26. package/src/prelude/values/helpers/function.hpp +108 -108
  27. package/src/prelude/values/helpers/iterator.hpp +144 -144
  28. package/src/prelude/values/helpers/promise.hpp +253 -253
  29. package/src/prelude/values/helpers/string.hpp +37 -61
  30. package/src/prelude/values/promise.hpp +72 -72
  31. package/src/prelude/values/prototypes/array.hpp +14 -2
  32. package/src/prelude/values/prototypes/iterator.hpp +201 -201
  33. package/src/prelude/values/prototypes/promise.hpp +196 -196
  34. package/src/prelude/values/prototypes/string.hpp +564 -542
  35. package/src/prelude/values/string.hpp +25 -26
@@ -42,16 +42,16 @@ export function visitClassDeclaration(node, context) {
42
42
  // Default constructor
43
43
  if (parentName) {
44
44
  constructorLambda =
45
- `jspp::AnyValue::make_class([=](jspp::AnyValue ${this.globalThisVar}, std::span<const jspp::AnyValue> args) mutable -> jspp::AnyValue {
46
- auto __parent = ${parentName};
47
- __parent.call(${this.globalThisVar}, args, "super");
48
- return jspp::Constants::UNDEFINED;
45
+ `jspp::AnyValue::make_class([=](jspp::AnyValue ${this.globalThisVar}, std::span<const jspp::AnyValue> args) mutable -> jspp::AnyValue {
46
+ auto __parent = ${parentName};
47
+ __parent.call(${this.globalThisVar}, args, "super");
48
+ return jspp::Constants::UNDEFINED;
49
49
  }, "${className}")`;
50
50
  }
51
51
  else {
52
52
  constructorLambda =
53
- `jspp::AnyValue::make_class([=](jspp::AnyValue ${this.globalThisVar}, std::span<const jspp::AnyValue> args) mutable -> jspp::AnyValue {
54
- return jspp::Constants::UNDEFINED;
53
+ `jspp::AnyValue::make_class([=](jspp::AnyValue ${this.globalThisVar}, std::span<const jspp::AnyValue> args) mutable -> jspp::AnyValue {
54
+ return jspp::Constants::UNDEFINED;
55
55
  }, "${className}")`;
56
56
  }
57
57
  }
@@ -366,7 +366,7 @@ export function visitExpressionStatement(node, context) {
366
366
  export function visitThrowStatement(node, context) {
367
367
  const throwStmt = node;
368
368
  const expr = this.visit(throwStmt.expression, context);
369
- return `${this.indent()}throw jspp::Exception(${expr});
369
+ return `${this.indent()}throw jspp::Exception(${expr});
370
370
  `;
371
371
  }
372
372
  export function visitTryStatement(node, context) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ugo-studio/jspp",
3
- "version": "0.2.9",
3
+ "version": "0.3.0",
4
4
  "description": "A modern transpiler that converts JavaScript code into high-performance, standard C++23.",
5
5
  "main": "dist/index.js",
6
6
  "module": "src/index.ts",