GithubHelp home page GithubHelp logo

Comments (5)

stefanpenner avatar stefanpenner commented on May 18, 2024

👍

from es6-promise.

stefanpenner avatar stefanpenner commented on May 18, 2024

so currently precisely 0 browser support this. Would we like to still check and override?

from es6-promise.

jakearchibald avatar jakearchibald commented on May 18, 2024

Happy to clobber all until we get an implementation that supports subclassing, then we can look at how best to feature test it.

from es6-promise.

stefanpenner avatar stefanpenner commented on May 18, 2024
  • subclass-ability is now a criteria for polyfil
  • update readme accordingly

Something like the following (although it adds many bytes).

var isNative = Object.prototype.toString.call(Promise.resolve())  === '[object Promise]';

function testSubclassing() {
  function SubClass() {
    Promise.call(this);
  }

  SubClass.prototype= Object.create(Promise.prototype)

  var seemsToSubClass;
  try {
    new SubClass(function() { });
    seemsToSubClass  = true;
  } catch(e) {
    seemsToSubClass = false
  }

  return seemsToSubClass;
}



if (isNative) {
  canSubclass = testSubClassing();
}

from es6-promise.

stefanpenner avatar stefanpenner commented on May 18, 2024

master should do this now, but If you have time to audit it that would be awesome.!

from es6-promise.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.