Socket
Socket
Sign inDemoInstall

extend-me

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extend-me - npm Package Compare versions

Comparing version 2.3.4 to 2.4.0

12

index.js

@@ -66,4 +66,4 @@ 'use strict';

function Constructor() {
if (prototypeAdditions.preInitialize) {
prototypeAdditions.preInitialize.apply(this, arguments);
if (this.preInitialize) {
this.preInitialize.apply(this, arguments);
}

@@ -73,4 +73,4 @@

if (prototypeAdditions.postInitialize) {
prototypeAdditions.postInitialize.apply(this, arguments);
if (this.postInitialize) {
this.postInitialize.apply(this, arguments);
}

@@ -150,4 +150,4 @@ }

* @property {function} [initialize] - Additional constructor code for new object. This method is added to the new constructor's prototype. Gets passed new object as context + same args as constructor itself. Called on instantiation after similar function in all ancestors called with same signature.
* @property {function} [preInitialize] - Called before the `initialize` cascade. Gets passed new object as context + same args as constructor itself.
* @property {function} [postInitialize] - Called after the `initialize` cascade. Gets passed new object as context + same args as constructor itself.
* @property {function} [preInitialize] - Called before the `initialize` cascade. Gets passed new object as context + same args as constructor itself. If not defined here, the top-most (and only the top-most) definition found on the prototype chain is called.
* @property {function} [postInitialize] - Called after the `initialize` cascade. Gets passed new object as context + same args as constructor itself. If not defined here, the top-most (and only the top-most) definition found on the prototype chain is called.
*/

@@ -154,0 +154,0 @@

{
"name": "extend-me",
"version": "2.3.4",
"version": "2.4.0",
"main": "index.js",

@@ -5,0 +5,0 @@ "description": "Yet another Backbone-like class extender",

# extend-me
Yet another Backbone-like class extender
### Update history
#### v2.4.0
Previously, on instantiation, the `preInitialize` and `postInitialize` methods were called if and only if they were defined on the subclass's (extended object's) own prototype. This has been changed so that the "top" such methods on the prototype chain are now called, whether defined on the extended class or on an ancestor class. As before, these methods are called before and after the `initialize` cascade, respectively. Unlike `initialize`, however, there is no cascade; only the top most method is ever called.
This was an oversight and the workaround has been to forward the calls by redefining new methods with these names whose sole function was to forward the call to `this.super`. This change is backwards compatible with that workaround; it will simply call the forwarding method as before. However, it is now safe to remove the forwarding methods altogether and the call will be made for you.
This can be considered a breaking change because previously without the workarounds, such ancestor methods were not executed. If you were dependent on this unlikely scenario, you can restore that behavior by defining new methods with these names as no-ops.
### Require/include

@@ -5,0 +14,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