Smaller cleanups in the Context class
authorLars Knoll <lars.knoll@digia.com>
Thu, 15 Nov 2012 11:58:49 +0000 (12:58 +0100)
committerSimon Hausmann <simon.hausmann@digia.com>
Thu, 15 Nov 2012 12:41:58 +0000 (13:41 +0100)
Change-Id: I02bc1cad6231988fdf453d0b4fdde55dd1ae9148
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
qmljs_runtime.h

index 51eec1a..f550b36 100644 (file)
@@ -589,35 +589,24 @@ struct Context {
 
     inline Value argument(unsigned int index = 0)
     {
-        Value arg;
-        getArgument(&arg, index);
-        return arg;
-    }
-
-    inline void getArgument(Value *result, unsigned int index)
-    {
         if (index < argumentCount)
-            *result = arguments[index];
-        else
-            *result = Value::undefinedValue();
+            return arguments[index];
+        return Value::undefinedValue();
     }
 
     void init(ExecutionEngine *eng);
 
-    void throwError(Value value);
-    void throwTypeError();
-    void throwReferenceError(Value value);
-
-#ifndef QMLJS_LLVM_RUNTIME
-    void throwError(const QString &message);
-    void throwUnimplemented(const QString &message);
-#endif
-
     void initCallContext(Context *parent, const Value *object, FunctionObject *f, Value *args, unsigned argc);
     void leaveCallContext();
 
     void initConstructorContext(Context *parent, Value *object, FunctionObject *f, Value *args, unsigned argc);
     void leaveConstructorContext(FunctionObject *f);
+
+    void throwError(Value value);
+    void throwError(const QString &message);
+    void throwTypeError();
+    void throwReferenceError(Value value);
+    void throwUnimplemented(const QString &message);
 };