GithubHelp home page GithubHelp logo

geoffreybooth / es6-javascript-class-interop Goto Github PK

View Code? Open in Web Editor NEW

This project forked from balupton/es6-javascript-class-interop

0.0 2.0 0.0 5 KB

Do ES6 classes classes play nicely with ES5 and CoffeeScript Classes?

CoffeeScript 14.93% JavaScript 85.07%

es6-javascript-class-interop's Introduction

JavaScript and CoffeeScript Classes Interoperability

Get the results

  1. clone the repo
  2. npm install
  3. npm test

What do the results say?

  • ES6 classes can extend ES5 and CoffeeScript classes
  • CoffeeScript can extend ES5 classes, but CoffeeScript cannot extend ES6 classes
  • ES5 can extend CoffeeScript classes, but ES5 cannot extend ES6 classes
classes interop
classes interop ➞  es5 extending es5
classes interop ➞  es5 extending es5 ✔
classes interop ➞  es5 extending es6
classes interop ➞  es5 extending es6 ✘
classes interop ➞  es5 extending coffee
classes interop ➞  es5 extending coffee ✔
classes interop ➞  es6 extending es5
classes interop ➞  es6 extending es5 ✔
classes interop ➞  es6 extending es6
classes interop ➞  es6 extending es6 ✔
classes interop ➞  es6 extending coffee
classes interop ➞  es6 extending coffee ✔
classes interop ➞  coffee extending es5
classes interop ➞  coffee extending es5 ✔
classes interop ➞  coffee extending es6
classes interop ➞  coffee extending es6 ✘
classes interop ➞  coffee extending coffee
classes interop ➞  coffee extending coffee ✔
classes interop ✔

FAILURE: 7/9 tests ran successfully; 2 failed, 0 incomplete, 2 errors

Error #1:
classes interop ➞  es5 extending es6
TypeError: Class constructors cannot be invoked without 'new'
    at new BaseClass (class.es:3:3)
    at BaseClass.NewClass (extends.js:3:16)
    at check (test.js:8:12)
    at EventEmitterGrouped.<anonymous> (test.js:38:5)
    at ambi (/Users/balupton/Projects/active/classes-coffeescript-vs-javascript/node_modules/ambi/out/lib/ambi.js:57:27)
    at Domain.fireMethod (/Users/balupton/Projects/active/classes-coffeescript-vs-javascript/node_modules/taskgroup/out/lib/taskgroup.js:385:23)
    at Domain.run (domain.js:228:14)
    at EventEmitterGrouped.Task.fire (/Users/balupton/Projects/active/classes-coffeescript-vs-javascript/node_modules/taskgroup/out/lib/taskgroup.js:423:27)
    at Immediate._onImmediate (/Users/balupton/Projects/active/classes-coffeescript-vs-javascript/node_modules/taskgroup/out/lib/taskgroup.js:440:26)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

Error #2:
classes interop ➞  coffee extending es6
TypeError: Class constructors cannot be invoked without 'new'
    at NewClass.BaseClass (class.es:3:3)
    at new NewClass (/Users/balupton/Projects/active/classes-coffeescript-vs-javascript/extends.coffee:11:40)
    at check (test.js:8:12)
    at EventEmitterGrouped.<anonymous> (test.js:38:5)
    at ambi (/Users/balupton/Projects/active/classes-coffeescript-vs-javascript/node_modules/ambi/out/lib/ambi.js:57:27)
    at Domain.fireMethod (/Users/balupton/Projects/active/classes-coffeescript-vs-javascript/node_modules/taskgroup/out/lib/taskgroup.js:385:23)
    at Domain.run (domain.js:228:14)
    at EventEmitterGrouped.Task.fire (/Users/balupton/Projects/active/classes-coffeescript-vs-javascript/node_modules/taskgroup/out/lib/taskgroup.js:423:27)
    at Immediate._onImmediate (/Users/balupton/Projects/active/classes-coffeescript-vs-javascript/node_modules/taskgroup/out/lib/taskgroup.js:440:26)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

npm ERR! Test failed.  See above for more details.

es6-javascript-class-interop's People

Contributors

balupton avatar geoffreybooth avatar

Watchers

 avatar  avatar

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.