@ugo-studio/jspp 0.2.9 → 0.3.1

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 (97) hide show
  1. package/LICENSE +25 -25
  2. package/README.md +20 -12
  3. package/dist/analysis/scope.js +5 -3
  4. package/dist/analysis/typeAnalyzer.js +21 -25
  5. package/dist/cli/index.js +14 -4
  6. package/dist/cli/utils.js +61 -0
  7. package/dist/core/codegen/class-handlers.js +6 -6
  8. package/dist/core/codegen/control-flow-handlers.js +10 -9
  9. package/dist/core/codegen/declaration-handlers.js +10 -3
  10. package/dist/core/codegen/destructuring-handlers.js +9 -4
  11. package/dist/core/codegen/expression-handlers.js +40 -29
  12. package/dist/core/codegen/function-handlers.js +78 -12
  13. package/dist/core/codegen/helpers.js +91 -14
  14. package/dist/core/codegen/index.js +4 -2
  15. package/dist/core/codegen/statement-handlers.js +9 -7
  16. package/package.json +2 -2
  17. package/scripts/precompile-headers.ts +249 -50
  18. package/scripts/setup-compiler.ts +63 -63
  19. package/src/prelude/any_value.cpp +636 -0
  20. package/src/prelude/any_value.hpp +369 -362
  21. package/src/prelude/{exception_helpers.hpp → exception.cpp} +53 -53
  22. package/src/prelude/exception.hpp +27 -27
  23. package/src/prelude/iterator_instantiations.hpp +10 -0
  24. package/src/prelude/{index.hpp → jspp.hpp} +10 -16
  25. package/src/prelude/library/array.cpp +191 -0
  26. package/src/prelude/library/array.hpp +13 -186
  27. package/src/prelude/library/console.cpp +125 -0
  28. package/src/prelude/library/console.hpp +24 -112
  29. package/src/prelude/library/error.cpp +100 -0
  30. package/src/prelude/library/error.hpp +13 -113
  31. package/src/prelude/library/function.cpp +69 -0
  32. package/src/prelude/library/function.hpp +11 -10
  33. package/src/prelude/library/global.cpp +96 -0
  34. package/src/prelude/library/global.hpp +12 -28
  35. package/src/prelude/library/global_usings.hpp +15 -0
  36. package/src/prelude/library/math.cpp +258 -0
  37. package/src/prelude/library/math.hpp +26 -308
  38. package/src/prelude/library/object.cpp +379 -0
  39. package/src/prelude/library/object.hpp +14 -276
  40. package/src/prelude/library/performance.cpp +21 -0
  41. package/src/prelude/library/performance.hpp +5 -20
  42. package/src/prelude/library/process.cpp +38 -0
  43. package/src/prelude/library/process.hpp +11 -39
  44. package/src/prelude/library/promise.cpp +131 -0
  45. package/src/prelude/library/promise.hpp +12 -123
  46. package/src/prelude/library/symbol.cpp +56 -0
  47. package/src/prelude/library/symbol.hpp +11 -52
  48. package/src/prelude/library/timer.cpp +88 -0
  49. package/src/prelude/library/timer.hpp +16 -92
  50. package/src/prelude/runtime.cpp +19 -0
  51. package/src/prelude/types.hpp +184 -179
  52. package/src/prelude/utils/access.hpp +502 -411
  53. package/src/prelude/utils/assignment_operators.hpp +99 -99
  54. package/src/prelude/utils/log_any_value/array.hpp +61 -40
  55. package/src/prelude/utils/log_any_value/function.hpp +39 -39
  56. package/src/prelude/utils/log_any_value/object.hpp +60 -3
  57. package/src/prelude/utils/operators.hpp +351 -336
  58. package/src/prelude/utils/operators_primitive.hpp +336 -336
  59. package/src/prelude/utils/well_known_symbols.hpp +24 -24
  60. package/src/prelude/values/array.cpp +1399 -0
  61. package/src/prelude/values/array.hpp +4 -1
  62. package/src/prelude/values/async_iterator.cpp +251 -0
  63. package/src/prelude/values/async_iterator.hpp +111 -83
  64. package/src/prelude/values/function.cpp +262 -0
  65. package/src/prelude/values/function.hpp +62 -82
  66. package/src/prelude/values/iterator.cpp +309 -0
  67. package/src/prelude/values/iterator.hpp +33 -64
  68. package/src/prelude/values/number.cpp +176 -0
  69. package/src/prelude/values/object.cpp +159 -0
  70. package/src/prelude/values/object.hpp +4 -0
  71. package/src/prelude/values/promise.cpp +479 -0
  72. package/src/prelude/values/promise.hpp +79 -72
  73. package/src/prelude/values/prototypes/array.hpp +46 -1336
  74. package/src/prelude/values/prototypes/async_iterator.hpp +19 -61
  75. package/src/prelude/values/prototypes/function.hpp +7 -46
  76. package/src/prelude/values/prototypes/iterator.hpp +25 -201
  77. package/src/prelude/values/prototypes/number.hpp +23 -210
  78. package/src/prelude/values/prototypes/object.hpp +7 -23
  79. package/src/prelude/values/prototypes/promise.hpp +18 -196
  80. package/src/prelude/values/prototypes/string.hpp +39 -542
  81. package/src/prelude/values/prototypes/symbol.hpp +9 -70
  82. package/src/prelude/values/shape.hpp +52 -52
  83. package/src/prelude/values/string.cpp +485 -0
  84. package/src/prelude/values/string.hpp +25 -26
  85. package/src/prelude/values/symbol.cpp +89 -0
  86. package/src/prelude/values/symbol.hpp +101 -101
  87. package/src/prelude/any_value_access.hpp +0 -170
  88. package/src/prelude/any_value_defines.hpp +0 -190
  89. package/src/prelude/any_value_helpers.hpp +0 -374
  90. package/src/prelude/values/helpers/array.hpp +0 -209
  91. package/src/prelude/values/helpers/async_iterator.hpp +0 -275
  92. package/src/prelude/values/helpers/function.hpp +0 -109
  93. package/src/prelude/values/helpers/iterator.hpp +0 -145
  94. package/src/prelude/values/helpers/object.hpp +0 -104
  95. package/src/prelude/values/helpers/promise.hpp +0 -254
  96. package/src/prelude/values/helpers/string.hpp +0 -61
  97. package/src/prelude/values/helpers/symbol.hpp +0 -21
@@ -1,99 +1,99 @@
1
- #pragma once
2
-
3
- #include "types.hpp"
4
- #include "any_value.hpp"
5
- #include "utils/operators.hpp"
6
-
7
- namespace jspp {
8
-
9
- // --- FRIEND IMPLEMENTATIONS ---
10
-
11
- inline AnyValue &operator+=(AnyValue &lhs, const AnyValue &rhs) {
12
- lhs = jspp::add(lhs, rhs);
13
- return lhs;
14
- }
15
-
16
- inline AnyValue &operator-=(AnyValue &lhs, const AnyValue &rhs) {
17
- lhs = jspp::sub(lhs, rhs);
18
- return lhs;
19
- }
20
-
21
- inline AnyValue &operator*=(AnyValue &lhs, const AnyValue &rhs) {
22
- lhs = jspp::mul(lhs, rhs);
23
- return lhs;
24
- }
25
-
26
- inline AnyValue &operator/=(AnyValue &lhs, const AnyValue &rhs) {
27
- lhs = jspp::div(lhs, rhs);
28
- return lhs;
29
- }
30
-
31
- inline AnyValue &operator%=(AnyValue &lhs, const AnyValue &rhs) {
32
- lhs = jspp::mod(lhs, rhs);
33
- return lhs;
34
- }
35
-
36
- inline AnyValue &operator++(AnyValue &val) {
37
- val = jspp::add(val, 1.0);
38
- return val;
39
- }
40
-
41
- inline AnyValue operator++(AnyValue &val, int) {
42
- AnyValue temp = val;
43
- val = jspp::add(val, 1.0);
44
- return temp;
45
- }
46
-
47
- inline AnyValue &operator--(AnyValue &val) {
48
- val = jspp::sub(val, 1.0);
49
- return val;
50
- }
51
-
52
- inline AnyValue operator--(AnyValue &val, int) {
53
- AnyValue temp = val;
54
- val = jspp::sub(val, 1.0);
55
- return temp;
56
- }
57
-
58
- // --- OVERLOADS FOR PRIMITIVES ---
59
-
60
- inline AnyValue &operator+=(AnyValue &lhs, const double &rhs) {
61
- lhs = jspp::add(lhs, rhs);
62
- return lhs;
63
- }
64
- inline AnyValue &operator+=(AnyValue &lhs, const int &rhs) {
65
- return lhs += static_cast<double>(rhs);
66
- }
67
-
68
- inline AnyValue &operator-=(AnyValue &lhs, const double &rhs) {
69
- lhs = jspp::sub(lhs, rhs);
70
- return lhs;
71
- }
72
- inline AnyValue &operator-=(AnyValue &lhs, const int &rhs) {
73
- return lhs -= static_cast<double>(rhs);
74
- }
75
-
76
- inline AnyValue &operator*=(AnyValue &lhs, const double &rhs) {
77
- lhs = jspp::mul(lhs, rhs);
78
- return lhs;
79
- }
80
- inline AnyValue &operator*=(AnyValue &lhs, const int &rhs) {
81
- return lhs *= static_cast<double>(rhs);
82
- }
83
-
84
- inline AnyValue &operator/=(AnyValue &lhs, const double &rhs) {
85
- lhs = jspp::div(lhs, rhs);
86
- return lhs;
87
- }
88
- inline AnyValue &operator/=(AnyValue &lhs, const int &rhs) {
89
- return lhs /= static_cast<double>(rhs);
90
- }
91
-
92
- inline AnyValue &operator%=(AnyValue &lhs, const double &rhs) {
93
- lhs = jspp::mod(lhs, rhs);
94
- return lhs;
95
- }
96
- inline AnyValue &operator%=(AnyValue &lhs, const int &rhs) {
97
- return lhs %= static_cast<double>(rhs);
98
- }
99
- }
1
+ #pragma once
2
+
3
+ #include "types.hpp"
4
+ #include "any_value.hpp"
5
+ #include "utils/operators.hpp"
6
+
7
+ namespace jspp {
8
+
9
+ // --- FRIEND IMPLEMENTATIONS ---
10
+
11
+ inline AnyValue &operator+=(AnyValue &lhs, const AnyValue &rhs) {
12
+ lhs = jspp::add(lhs, rhs);
13
+ return lhs;
14
+ }
15
+
16
+ inline AnyValue &operator-=(AnyValue &lhs, const AnyValue &rhs) {
17
+ lhs = jspp::sub(lhs, rhs);
18
+ return lhs;
19
+ }
20
+
21
+ inline AnyValue &operator*=(AnyValue &lhs, const AnyValue &rhs) {
22
+ lhs = jspp::mul(lhs, rhs);
23
+ return lhs;
24
+ }
25
+
26
+ inline AnyValue &operator/=(AnyValue &lhs, const AnyValue &rhs) {
27
+ lhs = jspp::div(lhs, rhs);
28
+ return lhs;
29
+ }
30
+
31
+ inline AnyValue &operator%=(AnyValue &lhs, const AnyValue &rhs) {
32
+ lhs = jspp::mod(lhs, rhs);
33
+ return lhs;
34
+ }
35
+
36
+ inline AnyValue &operator++(AnyValue &val) {
37
+ val = jspp::add(val, 1.0);
38
+ return val;
39
+ }
40
+
41
+ inline AnyValue operator++(AnyValue &val, int) {
42
+ AnyValue temp = val;
43
+ val = jspp::add(val, 1.0);
44
+ return temp;
45
+ }
46
+
47
+ inline AnyValue &operator--(AnyValue &val) {
48
+ val = jspp::sub(val, 1.0);
49
+ return val;
50
+ }
51
+
52
+ inline AnyValue operator--(AnyValue &val, int) {
53
+ AnyValue temp = val;
54
+ val = jspp::sub(val, 1.0);
55
+ return temp;
56
+ }
57
+
58
+ // --- OVERLOADS FOR PRIMITIVES ---
59
+
60
+ inline AnyValue &operator+=(AnyValue &lhs, const double &rhs) {
61
+ lhs = jspp::add(lhs, rhs);
62
+ return lhs;
63
+ }
64
+ inline AnyValue &operator+=(AnyValue &lhs, const int &rhs) {
65
+ return lhs += static_cast<double>(rhs);
66
+ }
67
+
68
+ inline AnyValue &operator-=(AnyValue &lhs, const double &rhs) {
69
+ lhs = jspp::sub(lhs, rhs);
70
+ return lhs;
71
+ }
72
+ inline AnyValue &operator-=(AnyValue &lhs, const int &rhs) {
73
+ return lhs -= static_cast<double>(rhs);
74
+ }
75
+
76
+ inline AnyValue &operator*=(AnyValue &lhs, const double &rhs) {
77
+ lhs = jspp::mul(lhs, rhs);
78
+ return lhs;
79
+ }
80
+ inline AnyValue &operator*=(AnyValue &lhs, const int &rhs) {
81
+ return lhs *= static_cast<double>(rhs);
82
+ }
83
+
84
+ inline AnyValue &operator/=(AnyValue &lhs, const double &rhs) {
85
+ lhs = jspp::div(lhs, rhs);
86
+ return lhs;
87
+ }
88
+ inline AnyValue &operator/=(AnyValue &lhs, const int &rhs) {
89
+ return lhs /= static_cast<double>(rhs);
90
+ }
91
+
92
+ inline AnyValue &operator%=(AnyValue &lhs, const double &rhs) {
93
+ lhs = jspp::mod(lhs, rhs);
94
+ return lhs;
95
+ }
96
+ inline AnyValue &operator%=(AnyValue &lhs, const int &rhs) {
97
+ return lhs %= static_cast<double>(rhs);
98
+ }
99
+ }
@@ -18,7 +18,7 @@ namespace jspp
18
18
  {
19
19
  auto arr = val.as_array();
20
20
  size_t item_count = static_cast<size_t>(arr->length);
21
- size_t prop_count = arr->props.size();
21
+ size_t prop_count = arr->props.size() + arr->symbol_props.size();
22
22
 
23
23
  std::string indent(depth * 2, ' ');
24
24
  std::string next_indent((depth + 1) * 2, ' ');
@@ -102,28 +102,36 @@ namespace jspp
102
102
  }
103
103
 
104
104
  // Print properties
105
- if (prop_count > 0)
105
+ for (const auto &pair : arr->props)
106
106
  {
107
- ss << Color::BRIGHT_BLACK << ", " << Color::RESET;
107
+ if (!is_enumerable_property(pair.second))
108
+ continue;
108
109
 
109
- size_t current_prop = 0;
110
- for (const auto &pair : arr->props)
111
- {
112
- if (!is_enumerable_property(pair.second))
113
- continue;
110
+ if (needs_comma)
111
+ ss << Color::BRIGHT_BLACK << ", " << Color::RESET;
114
112
 
115
- if (is_valid_js_identifier(pair.first))
116
- {
117
- ss << pair.first;
118
- }
119
- else
120
- {
121
- ss << "\"" << pair.first << "\"";
122
- }
123
- ss << ": " << to_log_string(pair.second, visited, depth + 1);
124
- if (++current_prop < prop_count)
125
- ss << Color::BRIGHT_BLACK << ", " << Color::RESET;
113
+ if (is_valid_js_identifier(pair.first))
114
+ {
115
+ ss << pair.first;
126
116
  }
117
+ else
118
+ {
119
+ ss << "\"" << pair.first << "\"";
120
+ }
121
+ ss << ": " << to_log_string(pair.second, visited, depth + 1);
122
+ needs_comma = true;
123
+ }
124
+ for (const auto &pair : arr->symbol_props)
125
+ {
126
+ if (!is_enumerable_property(pair.second))
127
+ continue;
128
+
129
+ if (needs_comma)
130
+ ss << Color::BRIGHT_BLACK << ", " << Color::RESET;
131
+
132
+ ss << Color::BLUE << pair.first.to_std_string() << Color::RESET;
133
+ ss << ": " << to_log_string(pair.second, visited, depth + 1);
134
+ needs_comma = true;
127
135
  }
128
136
 
129
137
  ss << " ]";
@@ -193,34 +201,47 @@ namespace jspp
193
201
  ss << next_indent << Color::BRIGHT_BLACK << "... " << (item_count - items_to_show) << " more items" << Color::RESET;
194
202
  }
195
203
  // Print properties
196
- else if (prop_count > 0)
204
+ size_t current_prop = 0;
205
+ for (const auto &pair : arr->props)
197
206
  {
207
+ if (current_prop >= MAX_OBJECT_PROPS)
208
+ break;
209
+ if (!is_enumerable_property(pair.second))
210
+ continue;
211
+
198
212
  if (first_item_printed)
199
213
  ss << Color::BRIGHT_BLACK << ",\n"
200
214
  << Color::RESET;
201
215
 
202
- size_t current_prop = 0;
203
- for (const auto &pair : arr->props)
216
+ ss << next_indent;
217
+ if (is_valid_js_identifier(pair.first))
204
218
  {
205
- if (current_prop >= MAX_OBJECT_PROPS)
206
- break;
207
- if (!is_enumerable_property(pair.second))
208
- continue;
209
-
210
- ss << next_indent;
211
- if (is_valid_js_identifier(pair.first))
212
- {
213
- ss << pair.first;
214
- }
215
- else
216
- {
217
- ss << "\"" << pair.first << "\"";
218
- }
219
- ss << ": " << to_log_string(pair.second, visited, depth + 1);
220
- if (++current_prop < prop_count)
221
- ss << Color::BRIGHT_BLACK << ",\n"
222
- << Color::RESET;
219
+ ss << pair.first;
223
220
  }
221
+ else
222
+ {
223
+ ss << "\"" << pair.first << "\"";
224
+ }
225
+ ss << ": " << to_log_string(pair.second, visited, depth + 1);
226
+ first_item_printed = true;
227
+ current_prop++;
228
+ }
229
+ for (const auto &pair : arr->symbol_props)
230
+ {
231
+ if (current_prop >= MAX_OBJECT_PROPS)
232
+ break;
233
+ if (!is_enumerable_property(pair.second))
234
+ continue;
235
+
236
+ if (first_item_printed)
237
+ ss << Color::BRIGHT_BLACK << ",\n"
238
+ << Color::RESET;
239
+
240
+ ss << next_indent;
241
+ ss << Color::BLUE << pair.first.to_std_string() << Color::RESET;
242
+ ss << ": " << to_log_string(pair.second, visited, depth + 1);
243
+ first_item_printed = true;
244
+ current_prop++;
224
245
  }
225
246
  ss << "\n";
226
247
  ss << indent << "]";
@@ -1,39 +1,39 @@
1
- #pragma once
2
- #include "types.hpp"
3
- #include "any_value.hpp"
4
- #include "utils/log_any_value/config.hpp"
5
- #include <string>
6
-
7
- namespace jspp
8
- {
9
- namespace LogAnyValue
10
- {
11
- inline std::string format_function(const AnyValue &val)
12
- {
13
- auto fn = val.as_function();
14
-
15
- if (fn->is_class)
16
- {
17
- std::string extends_part = "";
18
- if (!fn->proto.is_uninitialized() && !fn->proto.is_undefined() && !fn->proto.is_null())
19
- {
20
- if (fn->proto.is_function())
21
- {
22
- auto parent = fn->proto.as_function();
23
- std::string name = parent->name.value_or("");
24
- if (!name.empty())
25
- {
26
- extends_part = " extends " + name;
27
- }
28
- }
29
- }
30
- std::string name = fn->name.value_or("");
31
- return Color::CYAN + std::string("[class ") + (name.empty() ? "(anonymous)" : name) + extends_part + "]" + Color::RESET;
32
- }
33
-
34
- auto type_part = fn->is_generator ? "GeneratorFunction" : "Function";
35
- auto name_part = fn->name.has_value() ? ": " + fn->name.value() : " (anonymous)";
36
- return Color::CYAN + "[" + type_part + name_part + "]" + Color::RESET;
37
- }
38
- }
39
- }
1
+ #pragma once
2
+ #include "types.hpp"
3
+ #include "any_value.hpp"
4
+ #include "utils/log_any_value/config.hpp"
5
+ #include <string>
6
+
7
+ namespace jspp
8
+ {
9
+ namespace LogAnyValue
10
+ {
11
+ inline std::string format_function(const AnyValue &val)
12
+ {
13
+ auto fn = val.as_function();
14
+
15
+ if (fn->is_class)
16
+ {
17
+ std::string extends_part = "";
18
+ if (!fn->proto.is_uninitialized() && !fn->proto.is_undefined() && !fn->proto.is_null())
19
+ {
20
+ if (fn->proto.is_function())
21
+ {
22
+ auto parent = fn->proto.as_function();
23
+ std::string name = parent->name.value_or("");
24
+ if (!name.empty())
25
+ {
26
+ extends_part = " extends " + name;
27
+ }
28
+ }
29
+ }
30
+ std::string name = fn->name.value_or("");
31
+ return Color::CYAN + std::string("[class ") + (name.empty() ? "(anonymous)" : name) + extends_part + "]" + Color::RESET;
32
+ }
33
+
34
+ auto type_part = fn->is_generator ? "GeneratorFunction" : "Function";
35
+ auto name_part = fn->name.has_value() ? ": " + fn->name.value() : " (anonymous)";
36
+ return Color::CYAN + "[" + type_part + name_part + "]" + Color::RESET;
37
+ }
38
+ }
39
+ }
@@ -17,7 +17,7 @@ namespace jspp
17
17
  {
18
18
  auto obj = val.as_object();
19
19
 
20
- size_t prop_count = obj->storage.size();
20
+ size_t prop_count = obj->storage.size() + obj->symbol_props.size();
21
21
  bool use_horizontal_layout = prop_count > 0 && prop_count <= HORIZONTAL_OBJECT_MAX_PROPS;
22
22
 
23
23
  for (size_t i = 0; i < obj->storage.size(); ++i)
@@ -34,19 +34,47 @@ namespace jspp
34
34
  break;
35
35
  }
36
36
  }
37
+ for (const auto &pair : obj->symbol_props)
38
+ {
39
+ if (!is_enumerable_property(pair.second))
40
+ {
41
+ prop_count--;
42
+ continue;
43
+ }
44
+ if (use_horizontal_layout && !is_simple_value(pair.second))
45
+ {
46
+ use_horizontal_layout = false;
47
+ break;
48
+ }
49
+ }
37
50
 
38
51
  std::string indent(depth * 2, ' ');
39
52
  std::string next_indent((depth + 1) * 2, ' ');
40
53
  std::stringstream ss;
54
+ // ... (omitting intermediate parts for brevity in explanation, but including in replacement)
55
+ // Use Symbol.toStringTag for object prefix
56
+ bool has_tag = false;
57
+ try
58
+ {
59
+ auto tag_val = val.get_own_property(AnyValue::from_symbol(WellKnownSymbols::toStringTag));
60
+ if (tag_val.is_string())
61
+ {
62
+ ss << tag_val.to_std_string() << " ";
63
+ has_tag = true;
64
+ }
65
+ }
66
+ catch (...)
67
+ {
68
+ }
41
69
 
42
70
  // Special handling for Error objects
43
71
  try
44
72
  {
45
73
  const AnyValue args[] = {val};
46
- auto is_error = is_truthy(isErrorFn.call(isErrorFn, std::span<const AnyValue>(args, 1)));
74
+ auto is_error = is_truthy(isErrorFn.call(isErrorFn, std::span<const jspp::AnyValue>(args, 1)));
47
75
  if (is_error)
48
76
  {
49
- auto result = errorToStringFn.call(val, std::span<const AnyValue>{});
77
+ auto result = errorToStringFn.call(val, std::span<const jspp::AnyValue>{});
50
78
  if (result.is_string())
51
79
  {
52
80
  ss << result.to_std_string();
@@ -88,6 +116,18 @@ namespace jspp
88
116
  if (++current_prop < prop_count)
89
117
  ss << Color::BRIGHT_BLACK << ", " << Color::RESET;
90
118
  }
119
+ for (const auto &pair : obj->symbol_props)
120
+ {
121
+ if (!is_enumerable_property(pair.second))
122
+ continue;
123
+
124
+ ss << Color::BRIGHT_BLACK << "[" << Color::RESET;
125
+ ss << Color::BLUE << pair.first.to_std_string() << Color::RESET;
126
+ ss << Color::BRIGHT_BLACK << "]: " << Color::RESET;
127
+ ss << to_log_string(pair.second, visited, depth + 1);
128
+ if (++current_prop < prop_count)
129
+ ss << Color::BRIGHT_BLACK << ", " << Color::RESET;
130
+ }
91
131
  ss << " }";
92
132
  }
93
133
  else
@@ -124,6 +164,23 @@ namespace jspp
124
164
  ss << to_log_string(prop_val, visited, depth + 1);
125
165
  props_shown++;
126
166
  }
167
+ for (const auto &pair : obj->symbol_props)
168
+ {
169
+ if (props_shown >= MAX_OBJECT_PROPS)
170
+ break;
171
+
172
+ if (!is_enumerable_property(pair.second))
173
+ continue;
174
+
175
+ if (props_shown > 0)
176
+ ss << ",\n";
177
+
178
+ ss << next_indent;
179
+ ss << Color::BLUE << pair.first.to_std_string() << Color::RESET;
180
+ ss << Color::BRIGHT_BLACK << ": " << Color::RESET;
181
+ ss << to_log_string(pair.second, visited, depth + 1);
182
+ props_shown++;
183
+ }
127
184
  if (prop_count > MAX_OBJECT_PROPS)
128
185
  ss << ",\n"
129
186
  << next_indent << Color::BRIGHT_BLACK << "... " << (prop_count - MAX_OBJECT_PROPS) << " more properties" << Color::RESET;