Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit c297752

Browse files
JiaLiPassionmhevery
authored andcommitted
fix #577, canPatchViaPropertyDescriptor test should add configurable to XMLHttpRequest.prototype (#578)
1 parent 03d19f9 commit c297752

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: lib/browser/property-descriptor.ts

+6
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ function canPatchViaPropertyDescriptor() {
5656
if (desc && !desc.configurable) return false;
5757
}
5858

59+
// add enumerable and configurable here because in opera
60+
// by default XMLHttpRequest.prototype.onreadystatechange is undefined
61+
// without adding enumerable and configurable will cause onreadystatechange
62+
// non-configurable
5963
Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', {
64+
enumerable: true,
65+
configurable: true,
6066
get: function() {
6167
return true;
6268
}

0 commit comments

Comments
 (0)