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

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: Some test improvements. Created 6 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 unified diff | Download patch
« no previous file with comments | « src/messages.js ('k') | src/runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 74
75 75
76 MaybeObject* Object::ToObject(Context* native_context) { 76 MaybeObject* Object::ToObject(Context* native_context) {
77 if (IsNumber()) { 77 if (IsNumber()) {
78 return CreateJSValue(native_context->number_function(), this); 78 return CreateJSValue(native_context->number_function(), this);
79 } else if (IsBoolean()) { 79 } else if (IsBoolean()) {
80 return CreateJSValue(native_context->boolean_function(), this); 80 return CreateJSValue(native_context->boolean_function(), this);
81 } else if (IsString()) { 81 } else if (IsString()) {
82 return CreateJSValue(native_context->string_function(), this); 82 return CreateJSValue(native_context->string_function(), this);
83 } else if (IsSymbol()) {
84 return CreateJSValue(native_context->symbol_function(), this);
83 } 85 }
84 ASSERT(IsJSObject()); 86 ASSERT(IsJSObject());
85 return this; 87 return this;
86 } 88 }
87 89
88 90
89 MaybeObject* Object::ToObject(Isolate* isolate) { 91 MaybeObject* Object::ToObject(Isolate* isolate) {
90 if (IsJSReceiver()) { 92 if (IsJSReceiver()) {
91 return this; 93 return this;
92 } else if (IsNumber()) { 94 } else if (IsNumber()) {
(...skipping 16382 matching lines...) Expand 10 before | Expand all | Expand 10 after
16475 #define ERROR_MESSAGES_TEXTS(C, T) T, 16477 #define ERROR_MESSAGES_TEXTS(C, T) T,
16476 static const char* error_messages_[] = { 16478 static const char* error_messages_[] = {
16477 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16479 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16478 }; 16480 };
16479 #undef ERROR_MESSAGES_TEXTS 16481 #undef ERROR_MESSAGES_TEXTS
16480 return error_messages_[reason]; 16482 return error_messages_[reason];
16481 } 16483 }
16482 16484
16483 16485
16484 } } // namespace v8::internal 16486 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/messages.js ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698