diff --git a/build/v8_r19632/src/ast.h b/build/v8_r19632/src/ast.h index 2b33820..954d922 100644 --- a/build/v8_r19632/src/ast.h +++ b/build/v8_r19632/src/ast.h @@ -1366,6 +1366,31 @@ class Literal V8_FINAL : public Expression { ASSERT(!value_.is_null()); return value_->IsFalse(); } + bool IsUndefined() const { + ASSERT(!value_.is_null()); + return value_->IsUndefined(); + } + bool IsNumber() const { + ASSERT(!value_.is_null()); + return value_->IsNumber(); + } + bool IsJSObject() const { + ASSERT(!value_.is_null()); + return value_->IsJSObject(); + } + bool IsJSFunction() const { + ASSERT(!value_.is_null()); + return value_->IsJSFunction(); + } + bool IsJSArray() const { + ASSERT(!value_.is_null()); + return value_->IsJSArray(); + } + bool IsFixedArray() const { + ASSERT(!value_.is_null()); + return value_->IsFixedArray(); + } + Handle value() const { return value_; } diff --git a/src/AST.cpp b/src/AST.cpp index 58556b5..31949f5 100644 --- a/src/AST.cpp +++ b/src/AST.cpp @@ -265,6 +265,12 @@ void CAstNode::Expose(void) .add_property("isNull", &CAstLiteral::IsNull) .add_property("isTrue", &CAstLiteral::IsTrue) .add_property("isFalse", &CAstLiteral::IsFalse) + .add_property("isUndefined", &CAstLiteral::IsUndefined) + .add_property("isNumber", &CAstLiteral::IsNumber) + .add_property("IsJSObject", &CAstLiteral::IsJSObject) + .add_property("isJSFunction", &CAstLiteral::IsJSFunction) + .add_property("isJSArray", &CAstLiteral::IsJSArray) + .add_property("isFixedArray", &CAstLiteral::IsFixedArray) .add_property("asPropertyName", &CAstLiteral::AsPropertyName) ; @@ -310,6 +316,8 @@ void CAstNode::Expose(void) ; py::class_ >("AstProperty", py::no_init) + .add_property("obj", &CAstProperty::obj) + .add_property("key", &CAstProperty::key) ; py::class_ >("AstCall", py::no_init) diff --git a/src/AST.h b/src/AST.h index 84641df..c2c45d1 100644 --- a/src/AST.h +++ b/src/AST.h @@ -533,6 +533,12 @@ class CAstLiteral : public CAstExpression bool IsNull(void) const { return as()->IsNull(); } bool IsTrue(void) const { return as()->IsTrue(); } bool IsFalse(void) const { return as()->IsFalse(); } + bool IsUndefined(void) const { return as()->IsUndefined(); } + bool IsNumber(void) const { return as()->IsNumber(); } + bool IsJSObject(void) const { return as()->IsJSObject(); } + bool IsJSFunction(void) const { return as()->IsJSFunction(); } + bool IsJSArray(void) const { return as()->IsJSArray(); } + bool IsFixedArray(void) const { return as()->IsFixedArray(); } }; class CAstMaterializedLiteral : public CAstExpression @@ -601,6 +607,8 @@ class CAstProperty : public CAstExpression { public: CAstProperty(v8i::Zone *zone, v8i::Property *prop) : CAstExpression(zone, prop) {} + py::object obj(void) const { return to_python(m_zone, as()->obj()); } + py::object key(void) const { return to_python(m_zone, as()->key()); } }; class CAstCall : public CAstExpression