Skip to content

Commit

Permalink
fix unboxing object literals #257
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Jan 15, 2024
1 parent 395ee97 commit b87624f
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 35 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* fix error on extra close parenthesis [#263](https://github.com/jcubic/lips/issues/263)
* fix `scheme-report-environment` [#268](https://github.com/jcubic/lips/issues/268)
* fix writing to binary ports
* fix unboxing object literals

## 1.0.0-beta.17
### Breaking
Expand Down
27 changes: 15 additions & 12 deletions dist/lips.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/lips.esm.min.js

Large diffs are not rendered by default.

27 changes: 15 additions & 12 deletions dist/lips.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/lips.min.js

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions src/lips.js
Original file line number Diff line number Diff line change
Expand Up @@ -4320,16 +4320,12 @@ function box(object) {
function map_object(object, fn) {
const props = Object.getOwnPropertyNames(object);
const symbols = Object.getOwnPropertySymbols(object);
const result = {};
props.concat(symbols).forEach(key => {
const value = fn(object[key]);
// check if property is read only, happen with webpack
// and __esModule, it can happen for other properties as well
const descriptor = Object.getOwnPropertyDescriptor(object, key);
if (!descriptor || descriptor.writable && object[key] !== value) {
object[key] = value;
}
result[key] = value;
});
return object;
return result;
}
// ----------------------------------------------------------------------
function unbox(object) {
Expand Down

0 comments on commit b87624f

Please sign in to comment.