core-decorators
Advanced tools
Comparing version 0.12.1 to 0.12.2
@@ -77,4 +77,5 @@ 'use strict'; | ||
get: function get() { | ||
// This happens if someone accesses the property directly | ||
// on the prototype i.e. Klass.prototype.key | ||
// Class.prototype.key lookup | ||
// Someone accesses the property directly on the prototype on which it is | ||
// actually defined on, i.e. Class.prototype.hasOwnProperty(key) | ||
if (this === target) { | ||
@@ -84,5 +85,12 @@ return fn; | ||
// This is a confusing case where you have an autobound method calling | ||
// super.sameMethod() which is also autobound and so on. | ||
if (this.constructor !== constructor && this.constructor.prototype.hasOwnProperty(key)) { | ||
// Class.prototype.key lookup | ||
// Someone accesses the property directly on a prototype but it was found | ||
// up the chain, not defined directly on it | ||
// i.e. Class.prototype.hasOwnProperty(key) == false && key in Class.prototype | ||
if (this.constructor !== constructor && Object.getPrototypeOf(this).constructor === constructor) { | ||
return fn; | ||
} | ||
// Autobound method calling calling super.sameMethod() which is also autobound and so on. | ||
if (this.constructor !== constructor && key in this.constructor.prototype) { | ||
return getBoundSuper(this, fn); | ||
@@ -89,0 +97,0 @@ } |
{ | ||
"name": "core-decorators", | ||
"version": "0.12.1", | ||
"version": "0.12.2", | ||
"description": "Library of ES2016 (ES7) JavaScript decorators inspired by languages that come with built-ins like @override, @deprecate, @autobind, @mixin and more! Works great with React/Angular/more!", | ||
@@ -5,0 +5,0 @@ "main": "lib/core-decorators.js", |
@@ -66,4 +66,5 @@ import { decorate, createDefaultSetter, getOwnPropertyDescriptors } from './private/utils'; | ||
get() { | ||
// This happens if someone accesses the property directly | ||
// on the prototype i.e. Klass.prototype.key | ||
// Class.prototype.key lookup | ||
// Someone accesses the property directly on the prototype on which it is | ||
// actually defined on, i.e. Class.prototype.hasOwnProperty(key) | ||
if (this === target) { | ||
@@ -73,5 +74,12 @@ return fn; | ||
// This is a confusing case where you have an autobound method calling | ||
// super.sameMethod() which is also autobound and so on. | ||
if (this.constructor !== constructor && this.constructor.prototype.hasOwnProperty(key)) { | ||
// Class.prototype.key lookup | ||
// Someone accesses the property directly on a prototype but it was found | ||
// up the chain, not defined directly on it | ||
// i.e. Class.prototype.hasOwnProperty(key) == false && key in Class.prototype | ||
if (this.constructor !== constructor && Object.getPrototypeOf(this).constructor === constructor) { | ||
return fn; | ||
} | ||
// Autobound method calling calling super.sameMethod() which is also autobound and so on. | ||
if (this.constructor !== constructor && key in this.constructor.prototype) { | ||
return getBoundSuper(this, fn); | ||
@@ -78,0 +86,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83320
1777