Index: src/property-details-inl.h |
diff --git a/test/cctest/print-extension.h b/src/property-details-inl.h |
similarity index 77% |
copy from test/cctest/print-extension.h |
copy to src/property-details-inl.h |
index 7fe9226f7b48da3021496f63389eb71bb2971396..98eb1cf58e606c6d755210c91f18c21e51a8bfaa 100644 |
--- a/test/cctest/print-extension.h |
+++ b/src/property-details-inl.h |
@@ -25,23 +25,27 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-#ifndef V8_TEST_CCTEST_PRINT_EXTENSION_H_ |
-#define V8_TEST_CCTEST_PRINT_EXTENSION_H_ |
+#ifndef V8_PROPERTY_DETAILS_INL_H_ |
+#define V8_PROPERTY_DETAILS_INL_H_ |
-#include "v8.h" |
+#include "objects.h" |
+#include "property-details.h" |
+#include "v8conversions.h" |
namespace v8 { |
namespace internal { |
-class PrintExtension : public v8::Extension { |
- public: |
- PrintExtension() : v8::Extension("v8/print", "native function print();") { } |
- virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate( |
- v8::Isolate* isolate, |
- v8::Handle<v8::String> name); |
- static void Print(const v8::FunctionCallbackInfo<v8::Value>& args); |
-}; |
+inline bool Representation::CanContainDouble(double value) { |
+ if (IsDouble() || is_more_general_than(Representation::Double())) { |
+ return true; |
+ } |
+ if (IsInt32Double(value)) { |
+ if (IsInteger32()) return true; |
+ if (IsSmi()) return Smi::IsValid(static_cast<int32_t>(value)); |
+ } |
+ return false; |
+} |
} } // namespace v8::internal |
-#endif |
+#endif // V8_PROPERTY_DETAILS_INL_H_ |