Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support revert array in vm #69

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

mytEcust
Copy link
Contributor

@mytEcust mytEcust commented Jul 10, 2023

support revert in vm

Array.isArray(new vm.Script('[]').runInNewContext({}))
true
new vm.Script('[]').runInNewContext({}) instanceof Array
false

@mytEcust mytEcust force-pushed the feat/revertArrayInVm branch from 69ae281 to d44ed60 Compare July 10, 2023 09:58
lib/revert.js Outdated Show resolved Hide resolved
Object.prototype.toString.call(java) === '[object Boolean]'||
Object.prototype.toString.call(java) === '[object Date]' ||
Object.prototype.toString.call(java) === '[object Number]' ||
Object.prototype.toString.call(java) === '[object RegExp]' ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原来的 instanceof 也留着?全靠 toString 判断我也担心没法覆盖全。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已保留

@mytEcust mytEcust force-pushed the feat/revertArrayInVm branch from a46ead2 to db38a57 Compare July 10, 2023 14:30
@fengmk2 fengmk2 merged commit dcb2384 into node-modules:master Jul 11, 2023
@fengmk2
Copy link
Member

fengmk2 commented Jul 11, 2023

我改动 github action 跑完之后发一个版本。

fengmk2 pushed a commit that referenced this pull request Jul 11, 2023
[skip ci]

## [2.8.0](v2.7.0...v2.8.0) (2023-07-11)

### Features

* support revert array in vm ([#69](#69)) ([dcb2384](dcb2384))
@fengmk2
Copy link
Member

fengmk2 commented Jul 11, 2023

2.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants