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

Side by Side Diff: src/objects.cc

Issue 118553003: Upgrade Symbol implementation to match current ES6 behavior. (Closed) Base URL: git://github.com/v8/v8.git@bleeding_edge
Patch Set: Fix fundamental issues surrounding Symbol values vs (wrapper) objects Created 6 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 75
76 76
77 MaybeObject* Object::ToObject(Context* native_context) { 77 MaybeObject* Object::ToObject(Context* native_context) {
78 if (IsNumber()) { 78 if (IsNumber()) {
79 return CreateJSValue(native_context->number_function(), this); 79 return CreateJSValue(native_context->number_function(), this);
80 } else if (IsBoolean()) { 80 } else if (IsBoolean()) {
81 return CreateJSValue(native_context->boolean_function(), this); 81 return CreateJSValue(native_context->boolean_function(), this);
82 } else if (IsString()) { 82 } else if (IsString()) {
83 return CreateJSValue(native_context->string_function(), this); 83 return CreateJSValue(native_context->string_function(), this);
84 } else if (IsSymbol()) {
85 return CreateJSValue(native_context->symbol_function(), this);
84 } 86 }
85 ASSERT(IsJSObject()); 87 ASSERT(IsJSObject());
86 return this; 88 return this;
87 } 89 }
88 90
89 91
90 MaybeObject* Object::ToObject(Isolate* isolate) { 92 MaybeObject* Object::ToObject(Isolate* isolate) {
91 if (IsJSReceiver()) { 93 if (IsJSReceiver()) {
92 return this; 94 return this;
93 } else if (IsNumber()) { 95 } else if (IsNumber()) {
(...skipping 16538 matching lines...) Expand 10 before | Expand all | Expand 10 after
16632 #define ERROR_MESSAGES_TEXTS(C, T) T, 16634 #define ERROR_MESSAGES_TEXTS(C, T) T,
16633 static const char* error_messages_[] = { 16635 static const char* error_messages_[] = {
16634 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16636 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16635 }; 16637 };
16636 #undef ERROR_MESSAGES_TEXTS 16638 #undef ERROR_MESSAGES_TEXTS
16637 return error_messages_[reason]; 16639 return error_messages_[reason];
16638 } 16640 }
16639 16641
16640 16642
16641 } } // namespace v8::internal 16643 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698