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

Unified Diff: src/objects.h

Issue 1324713002: [es6] Implement Date.prototype[@@toPrimitive] as C++ builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address Michi's comments. Created 5 years, 4 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/date.js ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index f7aea06f9510966644b8235f3ba394fa765b3a74..03db209f13050d943702f10fffbca0a49e7b229c 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -173,6 +173,11 @@ enum KeyedAccessStoreMode {
enum class ToPrimitiveHint { kDefault, kNumber, kString };
+// Valid hints for the abstract operation OrdinaryToPrimitive,
+// implemented according to ES6, section 7.1.1.
+enum class OrdinaryToPrimitiveHint { kNumber, kString };
+
+
enum TypeofMode { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF };
@@ -1679,7 +1684,7 @@ class JSReceiver: public HeapObject {
Handle<JSReceiver> receiver,
ToPrimitiveHint hint = ToPrimitiveHint::kDefault);
MUST_USE_RESULT static MaybeHandle<Object> OrdinaryToPrimitive(
- Handle<JSReceiver> receiver, Handle<String> hint);
+ Handle<JSReceiver> receiver, OrdinaryToPrimitiveHint hint);
// Implementation of [[HasProperty]], ECMA-262 5th edition, section 8.12.6.
MUST_USE_RESULT static inline Maybe<bool> HasProperty(
@@ -7265,6 +7270,9 @@ class JSDate: public JSObject {
void SetValue(Object* value, bool is_value_nan);
+ // ES6 section 20.3.4.45 Date.prototype [ @@toPrimitive ]
+ static MUST_USE_RESULT MaybeHandle<Object> ToPrimitive(
+ Handle<JSReceiver> receiver, Handle<Object> hint);
// Dispatched behavior.
DECLARE_PRINTER(JSDate)
@@ -8115,6 +8123,10 @@ class Name: public HeapObject {
static inline Handle<Name> Flatten(Handle<Name> name,
PretenureFlag pretenure = NOT_TENURED);
+ // Return a string version of this name that is converted according to the
+ // rules described in ES6 section 9.2.11.
+ MUST_USE_RESULT static MaybeHandle<String> ToFunctionName(Handle<Name> name);
+
DECLARE_CAST(Name)
DECLARE_PRINTER(Name)
« no previous file with comments | « src/date.js ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698