Opened 5 years ago

Last modified 5 years ago

#3873 closed change

Replace more occurrences of __proto__ with Object.create(null) — at Version 2

Reported by: sebastian Assignee:
Priority: Unknown Milestone:
Module: Core Keywords:
Cc: Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by sebastian)


The special property __proto__ has only recently been added to the ES standard as a legacy feature. Moreover, object literals using __proto__ causes the whole function to be deoptimized on V8.

Anyway, for a while we avoid using __proto__ now where easily possible, in particular for objects used as a hash-table. With #656, we even migrated most of the code to use Object.create(null) where possible. But it seems some bits have been overlooked or got reintroduced later.

Most notably, is currently using __proto__ in an object literal, triggering a deoptimization on V8, that effects filter matching performance.

What to change

Replace object literals using __proto__: null with Object.create(null).

Change History (2)

comment:1 Changed 5 years ago by sebastian

  • Description modified (diff)

comment:2 Changed 5 years ago by sebastian

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing
Note: See TracTickets for help on using tickets.