mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:37:35 +00:00
LibJS: run clang-format on all the files
This commit is contained in:
parent
30519c22f6
commit
8bd9f7e50e
8 changed files with 25 additions and 25 deletions
|
@ -50,7 +50,7 @@ create_ast_node(Args&&... args)
|
||||||
|
|
||||||
class ASTNode : public RefCounted<ASTNode> {
|
class ASTNode : public RefCounted<ASTNode> {
|
||||||
public:
|
public:
|
||||||
virtual ~ASTNode() {}
|
virtual ~ASTNode() { }
|
||||||
virtual const char* class_name() const = 0;
|
virtual const char* class_name() const = 0;
|
||||||
virtual Value execute(Interpreter&) const = 0;
|
virtual Value execute(Interpreter&) const = 0;
|
||||||
virtual void dump(int indent) const;
|
virtual void dump(int indent) const;
|
||||||
|
@ -63,7 +63,7 @@ public:
|
||||||
virtual bool is_new_expression() const { return false; }
|
virtual bool is_new_expression() const { return false; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ASTNode() {}
|
ASTNode() { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
@ -120,7 +120,7 @@ public:
|
||||||
const NonnullRefPtrVector<VariableDeclaration>& variables() const { return m_variables; }
|
const NonnullRefPtrVector<VariableDeclaration>& variables() const { return m_variables; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ScopeNode() {}
|
ScopeNode() { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual bool is_scope_node() const final { return true; }
|
virtual bool is_scope_node() const final { return true; }
|
||||||
|
@ -130,7 +130,7 @@ private:
|
||||||
|
|
||||||
class Program : public ScopeNode {
|
class Program : public ScopeNode {
|
||||||
public:
|
public:
|
||||||
Program() {}
|
Program() { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual bool is_program() const override { return true; }
|
virtual bool is_program() const override { return true; }
|
||||||
|
@ -139,7 +139,7 @@ private:
|
||||||
|
|
||||||
class BlockStatement : public ScopeNode {
|
class BlockStatement : public ScopeNode {
|
||||||
public:
|
public:
|
||||||
BlockStatement() {}
|
BlockStatement() { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual const char* class_name() const override { return "BlockStatement"; }
|
virtual const char* class_name() const override { return "BlockStatement"; }
|
||||||
|
@ -454,7 +454,7 @@ private:
|
||||||
|
|
||||||
class Literal : public Expression {
|
class Literal : public Expression {
|
||||||
protected:
|
protected:
|
||||||
explicit Literal() {}
|
explicit Literal() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
class BooleanLiteral final : public Literal {
|
class BooleanLiteral final : public Literal {
|
||||||
|
@ -507,7 +507,7 @@ private:
|
||||||
|
|
||||||
class NullLiteral final : public Literal {
|
class NullLiteral final : public Literal {
|
||||||
public:
|
public:
|
||||||
explicit NullLiteral() {}
|
explicit NullLiteral() { }
|
||||||
|
|
||||||
virtual Value execute(Interpreter&) const override;
|
virtual Value execute(Interpreter&) const override;
|
||||||
virtual void dump(int indent) const override;
|
virtual void dump(int indent) const override;
|
||||||
|
@ -935,7 +935,7 @@ private:
|
||||||
|
|
||||||
class BreakStatement final : public Statement {
|
class BreakStatement final : public Statement {
|
||||||
public:
|
public:
|
||||||
BreakStatement() {}
|
BreakStatement() { }
|
||||||
|
|
||||||
virtual Value execute(Interpreter&) const override;
|
virtual Value execute(Interpreter&) const override;
|
||||||
|
|
||||||
|
@ -945,7 +945,7 @@ private:
|
||||||
|
|
||||||
class ContinueStatement final : public Statement {
|
class ContinueStatement final : public Statement {
|
||||||
public:
|
public:
|
||||||
ContinueStatement() {}
|
ContinueStatement() { }
|
||||||
|
|
||||||
virtual Value execute(Interpreter&) const override;
|
virtual Value execute(Interpreter&) const override;
|
||||||
|
|
||||||
|
@ -955,7 +955,7 @@ private:
|
||||||
|
|
||||||
class DebuggerStatement final : public Statement {
|
class DebuggerStatement final : public Statement {
|
||||||
public:
|
public:
|
||||||
DebuggerStatement() {}
|
DebuggerStatement() { }
|
||||||
|
|
||||||
virtual Value execute(Interpreter&) const override;
|
virtual Value execute(Interpreter&) const override;
|
||||||
|
|
||||||
|
|
|
@ -198,7 +198,7 @@ Cell* Heap::cell_from_possible_pointer(FlatPtr pointer)
|
||||||
|
|
||||||
class MarkingVisitor final : public Cell::Visitor {
|
class MarkingVisitor final : public Cell::Visitor {
|
||||||
public:
|
public:
|
||||||
MarkingVisitor() {}
|
MarkingVisitor() { }
|
||||||
|
|
||||||
virtual void visit_impl(Cell* cell)
|
virtual void visit_impl(Cell* cell)
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,7 +39,7 @@ BooleanPrototype::BooleanPrototype()
|
||||||
put_native_function("valueOf", value_of, 0, Attribute::Writable | Attribute::Configurable);
|
put_native_function("valueOf", value_of, 0, Attribute::Writable | Attribute::Configurable);
|
||||||
}
|
}
|
||||||
|
|
||||||
BooleanPrototype::~BooleanPrototype() {}
|
BooleanPrototype::~BooleanPrototype() { }
|
||||||
|
|
||||||
Value BooleanPrototype::to_string(Interpreter& interpreter)
|
Value BooleanPrototype::to_string(Interpreter& interpreter)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,16 +48,16 @@ Error::~Error()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName) \
|
#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName) \
|
||||||
ClassName* ClassName::create(GlobalObject& global_object, const String& message) \
|
ClassName* ClassName::create(GlobalObject& global_object, const String& message) \
|
||||||
{ \
|
{ \
|
||||||
return global_object.heap().allocate<ClassName>(message, *global_object.snake_name##_prototype()); \
|
return global_object.heap().allocate<ClassName>(message, *global_object.snake_name##_prototype()); \
|
||||||
} \
|
} \
|
||||||
ClassName::ClassName(const String& message, Object& prototype) \
|
ClassName::ClassName(const String& message, Object& prototype) \
|
||||||
: Error(#ClassName, message, prototype) \
|
: Error(#ClassName, message, prototype) \
|
||||||
{ \
|
{ \
|
||||||
} \
|
} \
|
||||||
ClassName::~ClassName() {} \
|
ClassName::~ClassName() { } \
|
||||||
const char* ClassName::class_name() const { return #ClassName; }
|
const char* ClassName::class_name() const { return #ClassName; }
|
||||||
|
|
||||||
JS_ENUMERATE_ERROR_SUBCLASSES
|
JS_ENUMERATE_ERROR_SUBCLASSES
|
||||||
|
|
|
@ -62,7 +62,7 @@ Value ErrorConstructor::construct(Interpreter& interpreter)
|
||||||
put("prototype", interpreter().global_object().snake_name##_prototype(), 0); \
|
put("prototype", interpreter().global_object().snake_name##_prototype(), 0); \
|
||||||
put("length", Value(1), Attribute::Configurable); \
|
put("length", Value(1), Attribute::Configurable); \
|
||||||
} \
|
} \
|
||||||
ConstructorName::~ConstructorName() {} \
|
ConstructorName::~ConstructorName() { } \
|
||||||
Value ConstructorName::call(Interpreter& interpreter) \
|
Value ConstructorName::call(Interpreter& interpreter) \
|
||||||
{ \
|
{ \
|
||||||
return construct(interpreter); \
|
return construct(interpreter); \
|
||||||
|
|
|
@ -109,7 +109,7 @@ Value ErrorPrototype::to_string(Interpreter& interpreter)
|
||||||
: Object(interpreter().global_object().error_prototype()) \
|
: Object(interpreter().global_object().error_prototype()) \
|
||||||
{ \
|
{ \
|
||||||
} \
|
} \
|
||||||
PrototypeName::~PrototypeName() {} \
|
PrototypeName::~PrototypeName() { } \
|
||||||
const char* PrototypeName::class_name() const { return #PrototypeName; }
|
const char* PrototypeName::class_name() const { return #PrototypeName; }
|
||||||
|
|
||||||
JS_ENUMERATE_ERROR_SUBCLASSES
|
JS_ENUMERATE_ERROR_SUBCLASSES
|
||||||
|
|
|
@ -35,7 +35,7 @@ MarkedValueList::MarkedValueList(Heap& heap)
|
||||||
m_heap.did_create_marked_value_list({}, *this);
|
m_heap.did_create_marked_value_list({}, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
MarkedValueList:: MarkedValueList(MarkedValueList&& other)
|
MarkedValueList::MarkedValueList(MarkedValueList&& other)
|
||||||
: m_heap(other.m_heap)
|
: m_heap(other.m_heap)
|
||||||
, m_values(move(other.m_values))
|
, m_values(move(other.m_values))
|
||||||
{
|
{
|
||||||
|
|
|
@ -435,7 +435,7 @@ bool Object::has_own_property(const FlyString& property_name) const
|
||||||
i32 property_index = property_name.to_int(ok);
|
i32 property_index = property_name.to_int(ok);
|
||||||
if (ok && property_index >= 0) {
|
if (ok && property_index >= 0) {
|
||||||
if (is_string_object())
|
if (is_string_object())
|
||||||
return property_index < (i32)static_cast<const StringObject*>(this)->primitive_string().string().length();
|
return property_index < (i32) static_cast<const StringObject*>(this)->primitive_string().string().length();
|
||||||
if (static_cast<size_t>(property_index) >= m_elements.size())
|
if (static_cast<size_t>(property_index) >= m_elements.size())
|
||||||
return false;
|
return false;
|
||||||
return !m_elements[property_index].is_empty();
|
return !m_elements[property_index].is_empty();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue