Browse Source

Changing FormalParameters to string[]

Sebastien Ros 12 years ago
parent
commit
bdb555d063

+ 1 - 1
Jint/Engine.cs

@@ -98,7 +98,7 @@ namespace Jint
                 }
             }
 
-            Eval = new EvalFunctionInstance(this, new ObjectInstance(this, null), new Identifier[0], LexicalEnvironment.NewDeclarativeEnvironment(this, ExecutionContext.LexicalEnvironment), Options.IsStrict());
+            Eval = new EvalFunctionInstance(this, new ObjectInstance(this, null), new string[0], LexicalEnvironment.NewDeclarativeEnvironment(this, ExecutionContext.LexicalEnvironment), Options.IsStrict());
             Global.FastAddProperty("eval", Eval, true, false, true);
 
             _statements = new StatementInterpreter(this);

+ 1 - 1
Jint/Native/Function/EvalFunctionInstance.cs

@@ -10,7 +10,7 @@ namespace Jint.Native.Function
     {
         private readonly Engine _engine;
 
-        public EvalFunctionInstance(Engine engine, ObjectInstance prototype, Identifier[] parameters, LexicalEnvironment scope, bool strict) : base(engine, prototype, parameters, scope, strict)
+        public EvalFunctionInstance(Engine engine, ObjectInstance prototype, string[] parameters, LexicalEnvironment scope, bool strict) : base(engine, prototype, parameters, scope, strict)
         {
             _engine = engine;
         }

+ 2 - 2
Jint/Native/Function/FunctionInstance.cs

@@ -9,7 +9,7 @@ namespace Jint.Native.Function
     {
         private readonly Engine _engine;
 
-        protected FunctionInstance(Engine engine, ObjectInstance prototype, Identifier[] parameters, LexicalEnvironment scope, bool strict) : base(engine, prototype)
+        protected FunctionInstance(Engine engine, ObjectInstance prototype, string[] parameters, LexicalEnvironment scope, bool strict) : base(engine, prototype)
         {
             _engine = engine;
             FormalParameters = parameters;
@@ -27,7 +27,7 @@ namespace Jint.Native.Function
 
         public LexicalEnvironment Scope { get; private set; }
         
-        public Identifier[] FormalParameters { get; private set; }
+        public string[] FormalParameters { get; private set; }
         public bool Strict { get; private set; }
 
         // todo: implement

+ 1 - 1
Jint/Native/Function/FunctionShim.cs

@@ -8,7 +8,7 @@ namespace Jint.Native.Function
     {
         private readonly Engine _engine;
 
-        public FunctionShim(Engine engine, ObjectInstance prototype, Identifier[] parameters, LexicalEnvironment scope) : base(engine, prototype, parameters, scope, false)
+        public FunctionShim(Engine engine, ObjectInstance prototype, string[] parameters, LexicalEnvironment scope) : base(engine, prototype, parameters, scope, false)
         {
             _engine = engine;
         }

+ 1 - 1
Jint/Native/Function/ScriptFunctionInstance.cs

@@ -18,7 +18,7 @@ namespace Jint.Native.Function
         private readonly IFunctionDeclaration _functionDeclaration;
         
         public ScriptFunctionInstance(Engine engine, IFunctionDeclaration functionDeclaration, ObjectInstance instancePrototype, ObjectInstance functionPrototype, LexicalEnvironment scope, bool strict)
-            : base(engine, instancePrototype, functionDeclaration.Parameters.ToArray(), scope, strict)
+            : base(engine, instancePrototype, functionDeclaration.Parameters.Select(x => x.Name).ToArray(), scope, strict)
         {
             // http://www.ecma-international.org/ecma-262/5.1/#sec-13.2
 

+ 1 - 1
Jint/Native/Function/ThrowTypeError.cs

@@ -8,7 +8,7 @@ namespace Jint.Native.Function
     {
         private readonly Engine _engine;
 
-        public ThrowTypeError(Engine engine): base(engine, engine.Function, new Identifier[0], engine.GlobalEnvironment, false)
+        public ThrowTypeError(Engine engine): base(engine, engine.Function, new string[0], engine.GlobalEnvironment, false)
         {
             _engine = engine;
             DefineOwnProperty("length", new DataDescriptor(0) { Writable = false, Enumerable = false, Configurable = false }, false);