Skip to content

Commit 45fc105

Browse files
authored
Remove The performance hazards of [[Prototype]] mutation page (mdn#20018)
1 parent d44cca0 commit 45fc105

File tree

5 files changed

+4
-158
lines changed

5 files changed

+4
-158
lines changed

files/en-us/_redirects.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12251,7 +12251,8 @@
1225112251
/en-US/docs/Web/JavaScript/Reference/rest_parameters /en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters
1225212252
/en-US/docs/Web/JavaScript/Reference/template_strings /en-US/docs/Web/JavaScript/Reference/Template_literals
1225312253
/en-US/docs/Web/JavaScript/Same_origin_policy_for_JavaScript /en-US/docs/Web/Security/Same-origin_policy
12254-
/en-US/docs/Web/JavaScript/The_performance_hazards_of__[[Prototype]]_mutation /en-US/docs/Web/JavaScript/The_performance_hazards_of_prototype_mutation
12254+
/en-US/docs/Web/JavaScript/The_performance_hazards_of__[[Prototype]]_mutation /en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf
12255+
/en-US/docs/Web/JavaScript/The_performance_hazards_of_prototype_mutation /en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf
1225512256
/en-US/docs/Web/JavaScript/Tutorials /en-US/docs/Web/JavaScript
1225612257
/en-US/docs/Web/JavaScript/Typed_arrays/ArrayBuffer /en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer
1225712258
/en-US/docs/Web/JavaScript/Typed_arrays/ArrayBufferView /en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray

files/en-us/_wikihistory.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127162,10 +127162,6 @@
127162127162
"Hamstersoup"
127163127163
]
127164127164
},
127165-
"Web/JavaScript/The_performance_hazards_of_prototype_mutation": {
127166-
"modified": "2020-04-30T10:28:18.041Z",
127167-
"contributors": ["fscholz", "Waldo"]
127168-
},
127169127165
"Web/JavaScript/Typed_arrays": {
127170127166
"modified": "2020-10-15T21:04:01.905Z",
127171127167
"contributors": [

files/en-us/web/javascript/reference/global_objects/object/proto/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ browser-compat: javascript.builtins.Object.proto
1313
---
1414
{{JSRef}}{{Deprecated_header}}
1515

16-
> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of [how modern JavaScript engines optimize property accesses](https://mathiasbynens.be/notes/prototypes), currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [The performance hazards of [[Prototype]] mutation](/en-US/docs/Web/JavaScript/The_performance_hazards_of_prototype_mutation).
16+
> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `obj.__proto__ = ...` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes).
1717
1818
> **Warning:** While `Object.prototype.__proto__` is supported today in most browsers, its existence and exact behavior has only been standardized as a legacy feature to ensure compatibility for web browsers. For better support, use {{JSxRef("Object.getPrototypeOf()")}} and {{JSxRef("Object.setPrototypeOf()")}} instead.
1919

files/en-us/web/javascript/reference/global_objects/object/setprototypeof/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ browser-compat: javascript.builtins.Object.setPrototypeOf
1313

1414
The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](/en-US/docs/Web/JavaScript/Reference/Operators/null).
1515

16-
> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of [how modern JavaScript engines optimize property accesses](https://mathiasbynens.be/notes/prototypes), currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [The performance hazards of [[Prototype]] mutation](/en-US/docs/Web/JavaScript/The_performance_hazards_of_prototype_mutation).
16+
> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes).
1717
>
1818
> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using {{jsxref("Object.create()")}}.
1919

files/en-us/web/javascript/the_performance_hazards_of_prototype_mutation/index.md

Lines changed: 0 additions & 151 deletions
This file was deleted.

0 commit comments

Comments
 (0)