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

Unified Diff: src/objects-inl.h

Issue 12296026: ES6 symbols: Implement Symbol intrinsic and basic functionality (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed more comments Created 7 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/objects.cc ('k') | src/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 590023ec8a775dd2a47dfc3f0d5a98b5f2b3e507..c7de7cfedd6b2bedefb8c05e381ae50da84102a5 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -181,15 +181,19 @@ TYPE_CHECKER(HeapNumber, HEAP_NUMBER_TYPE)
TYPE_CHECKER(Symbol, SYMBOL_TYPE)
-bool Object::IsName() {
+bool Object::IsString() {
return Object::IsHeapObject()
- && HeapObject::cast(this)->map()->instance_type() <= LAST_NAME_TYPE;
+ && HeapObject::cast(this)->map()->instance_type() < FIRST_NONSTRING_TYPE;
}
-bool Object::IsString() {
- return Object::IsHeapObject()
- && HeapObject::cast(this)->map()->instance_type() < FIRST_NONSTRING_TYPE;
+bool Object::IsName() {
+ return IsString() || IsSymbol();
+}
+
+
+bool Object::IsUniqueName() {
+ return IsInternalizedString() || IsSymbol();
}
@@ -2424,6 +2428,7 @@ CAST_ACCESSOR(JSObject)
CAST_ACCESSOR(Smi)
CAST_ACCESSOR(HeapObject)
CAST_ACCESSOR(HeapNumber)
+CAST_ACCESSOR(Name)
CAST_ACCESSOR(Oddball)
CAST_ACCESSOR(JSGlobalPropertyCell)
CAST_ACCESSOR(SharedFunctionInfo)
« no previous file with comments | « src/objects.cc ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698