Skip to content
This repository was archived by the owner on Jul 31, 2020. It is now read-only.
This repository was archived by the owner on Jul 31, 2020. It is now read-only.

Date.now overwrites new EMCA 5.1 method #92

@sam-thirststudios

Description

@sam-thirststudios
Date.now = function() {
    return new Date(); };

Date.now was introduced as a native method in ECMAScript 5.1 (ECMA-262)
This should be updated to use a fallback/polyfill or removed completely to avoid potentially breaking any features that rely on the output from the new standardised method.

I noticed this was interfering with some transition/animation logic in some other plugins I was using.

See https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date/now or below for polyfill

if (!Date.now) {
  Date.now = function now() {
    return new Date().getTime();
  };
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions