Skip to content

Make array and object prototype singletons immutable for now#4142

Merged
lukastaegert merged 3 commits intomasterfrom
immutable-prototypes
Jun 17, 2021
Merged

Make array and object prototype singletons immutable for now#4142
lukastaegert merged 3 commits intomasterfrom
immutable-prototypes

Conversation

@lukastaegert
Copy link
Copy Markdown
Member

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:
Resolves #4140

Description

Currently, Rollup treats the Array and Object prototypes as singletons. This is problematic as we are still using a stateful helper class to implement this, which can lead to a memory leak when used in watch mode. This hopefully improves the situation. Note that in the future, we might rework this again if we ever get to the point that we track mutations of globals.

@lukastaegert lukastaegert force-pushed the immutable-prototypes branch from 4d12fd1 to 8383cf9 Compare June 16, 2021 05:27
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 16, 2021

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#immutable-prototypes

or load it into the REPL:
https://rollupjs.org/repl/?pr=4142

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 16, 2021

Codecov Report

Merging #4142 (2eb20e0) into master (c4f9d13) will increase coverage by 0.15%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4142      +/-   ##
==========================================
+ Coverage   98.13%   98.28%   +0.15%     
==========================================
  Files         201      201              
  Lines        7116     7116              
  Branches     2083     2084       +1     
==========================================
+ Hits         6983     6994      +11     
+ Misses         64       58       -6     
+ Partials       69       64       -5     
Impacted Files Coverage Δ
src/ast/nodes/shared/ArrayPrototype.ts 100.00% <ø> (ø)
src/ast/nodes/shared/ObjectPrototype.ts 100.00% <ø> (ø)
src/ast/nodes/ArrayExpression.ts 100.00% <100.00%> (ø)
src/ast/nodes/shared/ObjectEntity.ts 100.00% <100.00%> (+4.93%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4f9d13...2eb20e0. Read the comment docs.

@lukastaegert lukastaegert merged commit aa1b227 into master Jun 17, 2021
@lukastaegert lukastaegert deleted the immutable-prototypes branch June 17, 2021 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JavaScript heap out of memory due to memory leak

1 participant