浏览代码

LibJS: Move throw_completion(Value) out of line

This allows us to instrument this function locally without rebuilding
1000+ files.
Andreas Kling 2 年之前
父节点
当前提交
88b15b0819
共有 2 个文件被更改,包括 7 次插入4 次删除
  1. 6 0
      Userland/Libraries/LibJS/Runtime/Completion.cpp
  2. 1 4
      Userland/Libraries/LibJS/Runtime/Completion.h

+ 6 - 0
Userland/Libraries/LibJS/Runtime/Completion.cpp

@@ -120,4 +120,10 @@ ThrowCompletionOr<Value> await(VM& vm, Value value)
     return throw_completion(result);
     return throw_completion(result);
 }
 }
 
 
+// 6.2.3.3 ThrowCompletion ( value ), https://tc39.es/ecma262/#sec-throwcompletion
+Completion throw_completion(Value value)
+{
+    return { Completion::Type::Throw, value, {} };
+}
+
 }
 }

+ 1 - 4
Userland/Libraries/LibJS/Runtime/Completion.h

@@ -302,9 +302,6 @@ inline Completion normal_completion(Optional<Value> value)
 }
 }
 
 
 // 6.2.3.3 ThrowCompletion ( value ), https://tc39.es/ecma262/#sec-throwcompletion
 // 6.2.3.3 ThrowCompletion ( value ), https://tc39.es/ecma262/#sec-throwcompletion
-inline Completion throw_completion(Value value)
-{
-    return { Completion::Type::Throw, value, {} };
-}
+Completion throw_completion(Value);
 
 
 }
 }