FAQ Database Discussion Community


AspectJ can't work on Scala function literal?

scala,aspectj,function-literal
I have the following scala class and annotated aspectj class: package playasjectj import org.aspectj.lang.annotation.Pointcut import org.aspectj.lang.annotation.Aspect import org.aspectj.lang.annotation.Before class Entity { def foo(p:String):String ={ return p } def bar(handler:(String,String,Long)=>String):Unit={ handler("first", "second", 100L) } } object Entity { def main(args:Array[String]){ val inst = new Entity inst.foo("we are the champion") val handler...

Named functions in Javascript accessible before declaration, but function literals aren't [duplicate]

javascript,function-literal
This question already has an answer here: var functionName = function() {} vs function functionName() {} 21 answers I'm trying to figure out how this works. When I reference a named Javascript function that hasn't been declared yet, in some circumstances, it works. But if I use a function...