Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: polyfill.js

Issue 29697596: Issue 6388 - Wrap inherited function properties as well (Closed)
Patch Set: Created Feb. 14, 2018, 2:46 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: polyfill.js
diff --git a/polyfill.js b/polyfill.js
index f80c98f6ee6efed6b1da4d2fca0107723985f736..fb11bfad187b30ebd060878c748d3fad9ccfb781 100644
--- a/polyfill.js
+++ b/polyfill.js
@@ -78,7 +78,13 @@
if (!func)
return;
- let descriptor = Object.getOwnPropertyDescriptor(object, name);
+ let descriptor;
+ let objectProto = object;
+ do
Manish Jethani 2018/02/15 13:17:51 By the way I find this nicer too: let descrip
+ {
+ descriptor = Object.getOwnPropertyDescriptor(objectProto, name);
+ }
+ while (!descriptor && (objectProto = Object.getPrototypeOf(objectProto)));
Manish Jethani 2018/02/15 09:59:24 I think we should have a separate function called
delete descriptor["get"];
delete descriptor["set"];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld