OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |