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

Unified Diff: polyfill.js

Issue 29590603: Issue 5954 - Read-only properties cannot be assigned in strict mode in Edge (Closed)
Patch Set: Remove the comment Created Nov. 13, 2017, 11:06 a.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
===================================================================
--- a/polyfill.js
+++ b/polyfill.js
@@ -69,8 +69,10 @@
let func = object[name];
if (!func)
return;
-
- object[name] = function(...args)
+ let descriptor = Object.getOwnPropertyDescriptor(object, name);
+ delete descriptor["get"];
+ delete descriptor["set"];
+ descriptor.value = function(...args)
{
let callStack = new Error().stack;
@@ -111,6 +113,7 @@
});
});
};
+ Object.defineProperty(object, name, descriptor);
}
function shouldWrapAPIs()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld