Code Monkey home page Code Monkey logo

Comments (4)

weepy avatar weepy commented on August 24, 2024

ah that is a bug due to implicit block scope. i think i will remove it
as its more trouble than its worth. im away for the next week. but i
wil fix upon my return. you shold be able to do it yourself byremoving
block_scope from the default directive in the main include file.
cheers

On Wednesday, July 20, 2011, mahemoff
[email protected]
wrote:

I tried the following in Express:

var kaffeine = new (require("kaffeine"))();
app.register('.k', {
 compile: function(str, options) {
   return function(locals) { return kaffeine.compile(str) };
 }
});
app.get('/:script.js', function(req, res) {
 res.header('Content-Type', 'text/plain');
 res.render(req.params.script+".k", { layout: false });
});

but I get bad output, e.g. source:

$( () {
 $("input").attr("id", () { @name; });
});

converts to:
 $( ()(function() {
 return $("input").attr("id", ()(function() { return this.name; }).call(this));
}).call(this));

[the version in index.js is 0.0.6]

Reply to this email directly or view it on GitHub:
#37

from kaffeine.

mahemoff avatar mahemoff commented on August 24, 2024

Thanks, i'll let you know once I've tried that.

from kaffeine.

weepy avatar weepy commented on August 24, 2024

Hi - I pushed a new version without block scope.

By the way the documentation is out of date (sorry) -- functions are now
written with an arrow syntax, so your example should look like :

$ -> {
$("input").attr "id", -> @name
}

On Wed, Jul 20, 2011 at 6:39 PM, mahemoff <
[email protected]>wrote:

Thanks, i'll let you know once I've tried that.

Reply to this email directly or view it on GitHub:
#37 (comment)

from kaffeine.

mahemoff avatar mahemoff commented on August 24, 2024

Working great, thanks.

from kaffeine.

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.