327 |
FunctionObject obj = new FunctionObject |
FunctionObject obj = new FunctionObject |
328 |
(EngineInstance.GetEngineInstance(engine).GetFunctionPrototype(), |
(EngineInstance.GetEngineInstance(engine).GetFunctionPrototype(), |
329 |
this, scope); |
this, scope); |
330 |
|
|
331 |
// Add the function to the scope. |
// javascript allows for anonymous functions |
332 |
if(scope is IVariableAccess) |
if(name != null) |
|
{ |
|
|
((IVariableAccess)scope).SetVariable(name, obj); |
|
|
} |
|
|
else |
|
333 |
{ |
{ |
334 |
scope.Put(name, obj); |
// Add the function to the scope. |
335 |
|
if(scope is IVariableAccess) |
336 |
|
{ |
337 |
|
((IVariableAccess)scope).SetVariable(name, obj); |
338 |
|
} |
339 |
|
else |
340 |
|
{ |
341 |
|
scope.Put(name, obj); |
342 |
|
} |
343 |
} |
} |
344 |
|
|
345 |
// Nothing else to do. |
// Return compiled function object |
346 |
return Empty.Value; |
return obj; |
347 |
} |
} |
348 |
|
|
349 |
// Evaluate a formal parameter list. |
// Evaluate a formal parameter list. |