This repository was archived by the owner on Apr 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathFunctionNode.cs
More file actions
85 lines (74 loc) · 2.53 KB
/
FunctionNode.cs
File metadata and controls
85 lines (74 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//------------------------------------------------------------------------------
// <license file="FunctionNode.cs">
//
// The use and distribution terms for this software are contained in the file
// named 'LICENSE', which can be found in the resources directory of this
// distribution.
//
// By using this software in any fashion, you are agreeing to be bound by the
// terms of this license.
//
// </license>
//------------------------------------------------------------------------------
using System;
namespace EcmaScript.NET
{
public class FunctionNode : ScriptOrFnNode
{
virtual public string FunctionName
{
get
{
return functionName;
}
}
virtual public bool IgnoreDynamicScope
{
get
{
return itsIgnoreDynamicScope;
}
}
virtual public int FunctionType
{
get
{
return itsFunctionType;
}
}
public FunctionNode (string name)
: base (Token.FUNCTION)
{
functionName = name;
}
public virtual bool RequiresActivation
{
get
{
return itsNeedsActivation;
}
}
/// <summary>
/// There are three types of functions that can be defined. The first
/// is a function statement. This is a function appearing as a top-level
/// statement (i.e., not nested inside some other statement) in either a
/// script or a function.
///
/// The second is a function expression, which is a function appearing in
/// an expression except for the third type, which is...
///
/// The third type is a function expression where the expression is the
/// top-level expression in an expression statement.
///
/// The three types of functions have different treatment and must be
/// distinquished.
/// </summary>
public const int FUNCTION_STATEMENT = 1;
public const int FUNCTION_EXPRESSION = 2;
public const int FUNCTION_EXPRESSION_STATEMENT = 3;
internal string functionName;
internal bool itsNeedsActivation;
internal int itsFunctionType;
internal bool itsIgnoreDynamicScope;
}
}