Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

core-decorators

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

core-decorators - npm Package Compare versions

Comparing version 0.12.1 to 0.12.2

18

lib/autobind.js

@@ -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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc