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

fix(patchViaPropertyDescriptor): disable if properties are not configurable #43

Merged
merged 1 commit into from
Feb 20, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions zone.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,14 @@ Zone.patch = function patch () {

//
Zone.canPatchViaPropertyDescriptor = function () {
if (!Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'onclick') &&
typeof Element !== 'undefined') {
// WebKit https://bugs.webkit.org/show_bug.cgi?id=134364
// IDL interface attributes are not configurable
var desc = Object.getOwnPropertyDescriptor(Element.prototype, 'onclick');
if (desc && !desc.configurable) return false;
}

Object.defineProperty(HTMLElement.prototype, 'onclick', {
get: function () {
return true;
Expand Down