Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(901)

Unified Diff: src/conversions-inl.h

Issue 1642223003: [api] Make ObjectTemplate::SetNativeDataProperty() work even if the ObjectTemplate does not have a … (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Removed asserts preventing JSReceiver properties in ObjectTemplate Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/conversions.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/conversions-inl.h
diff --git a/src/conversions-inl.h b/src/conversions-inl.h
index 3e56799bc9bab501f43f6be91321d0c694336fa0..730e6477cbee3e0fb781d692ec971d5a32b7ba36 100644
--- a/src/conversions-inl.h
+++ b/src/conversions-inl.h
@@ -127,6 +127,10 @@ uint32_t NumberToUint32(Object* number) {
return DoubleToUint32(number->Number());
}
+int64_t NumberToInt64(Object* number) {
+ if (number->IsSmi()) return Smi::cast(number)->value();
+ return static_cast<int64_t>(number->Number());
+}
bool TryNumberToSize(Isolate* isolate, Object* number, size_t* result) {
SealHandleScope shs(isolate);
« no previous file with comments | « src/conversions.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698