[TxMt] Better JavaScript functions

Andreas Wahlin andreaswahlin at bredband.net
Sun Oct 9 09:56:52 UTC 2005


The effects were mainly that of all the possible ways for JavaScript  
to declare functions, covered in part by Gavin here
http://phrogz.net/JS/Classes/OOPinJS.html

I believe all are

function funcName(arg) { .. }
this.funcName = function(arg) { ... };
var funcName = function(arg) { ... };
object.prototype.funcName = function(arg) { ... };

and then instead of
function(arg) { ... };
you can have
new Function("arg", "...");
so for example this.funcName = new Function("arg1", "arg2", "alert 
(arg1+arg2);");

If anyone could confirm this it would be quite nice :)

Andreas

On Oct 9, 2005, at 10:51 , Allan Odgaard wrote:

> On 08/10/2005, at 18.03, Andreas Wahlin wrote:
>
>
>> Any chance of getting the expanded JavaScript function detection  
>> added to the default bundle?
>>
>
> What was the consensus on these? I seem to recall several versions  
> with comments?!?
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate
>




More information about the textmate mailing list