Commits

Anonymous committed 1c8a18b

issue #111 make v8 r9899 happy

Comments (0)

Files changed (3)

                 self.assertEquals("{ s = \"even\"; }", str(stmt.thenStatement))
                 self.assertEquals("{ s = \"odd\"; }", str(stmt.elseStatement))
 
-                self.assertFalse(stmt.condition.trivial)
-                self.assertFalse(stmt.condition.propertyName)
+                self.assertFalse(stmt.condition.isPropertyName)
 
         self.assertEquals(1, IfStatementChecker(self).test("var s; if (value % 2 == 0) { s = 'even'; } else { s = 'odd'; }"))
 
             def onLiteral(self, litr):
                 self.called += 1
 
-                self.assert_(litr.trivial)
-                self.assertFalse(litr.propertyName)
+                self.assertFalse(litr.isPropertyName)
                 self.assertFalse(litr.isNull)
                 self.assertFalse(litr.isTrue)
 
     ;
     
   py::class_<CAstExpression, py::bases<CAstNode> >("AstExpression", py::no_init)    
-    .add_property("trivial", &CAstExpression::IsTrivial)
-    .add_property("propertyName", &CAstExpression::IsPropertyName)
+    .add_property("isPropertyName", &CAstExpression::IsPropertyName)
     ;
 
   py::class_<CAstBreakableStatement, py::bases<CAstStatement> >("AstBreakableStatement", py::no_init)
     .add_property("isNull", &CAstLiteral::IsNull)
     .add_property("isTrue", &CAstLiteral::IsTrue)
     .add_property("isFalse", &CAstLiteral::IsFalse)
+    .add_property("asPropertyName", &CAstLiteral::AsPropertyName)
     ;
 
   py::class_<CAstMaterializedLiteral, py::bases<CAstExpression> >("AstMaterializedLiteral", py::no_init)
 protected:
   CAstExpression(v8i::Expression *expr) : CAstNode(expr) {}
 public:
-  bool IsTrivial(void) { return as<v8i::Expression>()->IsTrivial(); }
   bool IsPropertyName(void) { return as<v8i::Expression>()->IsPropertyName(); }
 };
 
 public:
   CAstLiteral(v8i::Literal *lit) : CAstExpression(lit) {}
 
-  bool IsTrivial(void) const { return as<v8i::Literal>()->IsTrivial(); }
-  bool IsPropertyName(void) const { return as<v8i::Literal>()->IsPropertyName(); }
+  const std::string AsPropertyName(void) const { return to_string(as<v8i::Literal>()->AsPropertyName()); }
   bool IsNull(void) const { return as<v8i::Literal>()->IsNull(); }
   bool IsTrue(void) const { return as<v8i::Literal>()->IsTrue(); }
   bool IsFalse(void) const { return as<v8i::Literal>()->IsFalse(); }