Git Product home page Git Product logo

coffee-script's People

Contributors

asalant avatar breckinloggins avatar brodyberg avatar cehoffman avatar chrislloyd avatar codelahoma avatar danielgtaylor avatar epidemian avatar geraldalewis avatar hden avatar hleumas avatar jashkenas avatar jawj avatar jeremybanks avatar matehat avatar maxtaco avatar michaelficarra avatar olsonjeffery avatar revence27 avatar satyr avatar sparecycles avatar spinda avatar sstephenson avatar stanangeloff avatar thejh avatar tim-smart avatar trevorburnham avatar troels avatar willmoffat avatar zmthy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

winmain leduong

coffee-script's Issues

Short aliases and classes

Hi,

First of all, thank you for creating this fork. It's exactly what I've been looking for.

I ran into an issue where the closure compiler throws an error when a short alias is used in an include within a namespaced Class.

For example, the following compiles fine:

include test.Test3 as test3

class Test extends test.Test2
    constructor: ->
        console.log("i am test")

However, if you qualify Test with a package name, it throws an error:

include test.Test3 as test3

class test.Test extends test.Test2
    constructor: ->
        console.log("i am test")

java.lang.RuntimeException: java.lang.RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.
null
  Node(NAME Arguments): externs.zip//es3.js:30:9
function Arguments() {}
  Parent(FUNCTION Arguments): externs.zip//es3.js:30:0
function Arguments() {}

    at com.google.javascript.jscomp.Compiler.runInCompilerThread(Compiler.java:740)
    at com.google.javascript.jscomp.Compiler.compile(Compiler.java:652)
    at com.google.javascript.jscomp.Compiler.compile(Compiler.java:608)
    at com.google.javascript.jscomp.AbstractCommandLineRunner.doRun(AbstractCommandLineRunner.java:778)
    at com.google.javascript.jscomp.AbstractCommandLineRunner.run(AbstractCommandLineRunner.java:372)
    at com.google.javascript.jscomp.CommandLineRunner.main(CommandLineRunner.java:993)

Now, if you remove the shortalias, it compiles fine again:

include test.Test3

class test.Test extends test.Test2
    constructor: ->
        console.log("i am test")

Any thoughts as to why this might be happening?

Thanks!

use with grunt-contrib-coffee -- and thanks

Hi, I've figured out how to get grunt-contrib-coffee to build using your fork and the goog option:

    coffee: {
      build: {
        options: {
          bare: true,
          goog: true
        },
        expand: true,
        cwd: 'src',
        dest: 'build',
        src: ['**/*.coffee'],
        ext: '.js'

      }
    },

But I had to go in and manually override their reference to coffee-script :( Anyway, I've put in a pull-request to them to allow me to specify the compiler myself so that I can use yours in the build process that I'm automating.

Awesome work. Thank you. I hope you keep going with it.

Code on Wiki Doesn't Compile

On this wiki page there is example outputted code.

// Generated by CoffeeScript 1.6.1
goog.provide('project.sub.someClass');
goog.require('project.sub2.anotherClass');

goog.scope(function(){

/**
This is an awesome constructor
@constructor 
@extends project.sub2.anotherClass
*/
project.sub.someClass = function() {
  this.doSomeStuff();
  project.sub.someClass.superClass_.constructor.call(this);
}
goog.inherits(project.sub.someClass, project.sub2.anotherClass);
var someClass = project.sub.someClass;

project.sub.someClass.staticMethod = function() {
  return alert(someClass.staticProperty);
};

project.sub.someClass.staticProperty = "Some value";

project.sub.someClass.prototype.doSomeStuff = function() {
  return alert("Doing some stuff!");
};

});

I tried copying and pasting that into the closure compiler appspot and selecting advanced, for the optimization category. I see this error:

JSC_MISSING_PROVIDE_ERROR: required "project.sub2.anotherClass" namespace never provided at line 3 character 0
goog.require('project.sub2.anotherClass');
^

Is the code not supposed to compile as posted, or did something change in the closure compiler since this was posted?

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.