Skip to content

Conversation

@bud-mo
Copy link

@bud-mo bud-mo commented Sep 27, 2017

If the library is loaded many time may cause trouble when try to define a property many time.
This modification skip to define the Date.prototype.toPrunedJSON if is already defined.

If the library is loaded many time may cause trouble when try to define a property many time.
This modification skip to define the `Date.prototype.toPrunedJSON` if is already defined.
};

Object.defineProperty(Date.prototype, "toPrunedJSON", {value:Date.prototype.toJSON});
if (typeof Date.prototype.toPrunedJSON === "undefined") {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change that to
if (Date.prototype.toPrunedJSON === undefined) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants