CaryLandholt / gulp-ng-classify

Convert CoffeeScript classes to AngularJS modules with ng-classify
MIT License
15 stars 4 forks source link

CoffeeScript v2 classes #12

Open Justinas-Jurciukonis opened 11 months ago

Justinas-Jurciukonis commented 11 months ago

Hello, is this still maintained repo?

I have very old project and updated CoffeeScript to gulp-coffee: ^3.0. This brings main difference to coffee: now it's classes instead of functions.

This is our source:

class AppConstant extends Constant
    constructor: ->
        return {
            API_CLIENT: 'admin_site'
        }

compiles into

var AppConstant;

AppConstant = class AppConstant {
  constructor() {
    return {
      API_CLIENT: 'admin_site'
    };
  }
};

angular.module('app.core').constant('AppConstant', AppConstant());

and in browser (FireFox 120.0) throw error TypeError: class constructors must be invoked with 'new'


Is there anything I can do to fix this?