瀏覽代碼

LibJS: Value.in uses has_property instead of get().is_empty()

Matthew Olsson 5 年之前
父節點
當前提交
58a72e9b81
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Libraries/LibJS/Runtime/Value.cpp

+ 1 - 1
Libraries/LibJS/Runtime/Value.cpp

@@ -539,7 +539,7 @@ Value in(Interpreter& interpreter, Value lhs, Value rhs)
     auto lhs_string = lhs.to_string(interpreter);
     if (interpreter.exception())
         return {};
-    return Value(!rhs.as_object().get(lhs_string).is_empty());
+    return Value(rhs.as_object().has_property(lhs_string));
 }
 
 Value instance_of(Interpreter&, Value lhs, Value rhs)