OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 *pending_exception = false; | 150 *pending_exception = false; |
151 | 151 |
152 if (!callable->IsJSFunction()) { | 152 if (!callable->IsJSFunction()) { |
153 callable = TryGetFunctionDelegate(callable, pending_exception); | 153 callable = TryGetFunctionDelegate(callable, pending_exception); |
154 if (*pending_exception) return callable; | 154 if (*pending_exception) return callable; |
155 } | 155 } |
156 Handle<JSFunction> func = Handle<JSFunction>::cast(callable); | 156 Handle<JSFunction> func = Handle<JSFunction>::cast(callable); |
157 | 157 |
158 // In non-strict mode, convert receiver. | 158 // In non-strict mode, convert receiver. |
159 if (convert_receiver && !receiver->IsJSReceiver() && | 159 if (convert_receiver && !receiver->IsJSReceiver() && |
160 !func->shared()->native() && !func->shared()->strict_mode()) { | 160 !func->shared()->native() && func->shared()->is_classic_mode()) { |
161 if (receiver->IsUndefined() || receiver->IsNull()) { | 161 if (receiver->IsUndefined() || receiver->IsNull()) { |
162 Object* global = func->context()->global()->global_receiver(); | 162 Object* global = func->context()->global()->global_receiver(); |
163 // Under some circumstances, 'global' can be the JSBuiltinsObject | 163 // Under some circumstances, 'global' can be the JSBuiltinsObject |
164 // In that case, don't rewrite. | 164 // In that case, don't rewrite. |
165 // (FWIW, the same holds for GetIsolate()->global()->global_receiver().) | 165 // (FWIW, the same holds for GetIsolate()->global()->global_receiver().) |
166 if (!global->IsJSBuiltinsObject()) receiver = Handle<Object>(global); | 166 if (!global->IsJSBuiltinsObject()) receiver = Handle<Object>(global); |
167 } else { | 167 } else { |
168 receiver = ToObject(receiver, pending_exception); | 168 receiver = ToObject(receiver, pending_exception); |
169 } | 169 } |
170 if (*pending_exception) return callable; | 170 if (*pending_exception) return callable; |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 return isolate->TerminateExecution(); | 898 return isolate->TerminateExecution(); |
899 } | 899 } |
900 if (stack_guard->IsInterrupted()) { | 900 if (stack_guard->IsInterrupted()) { |
901 stack_guard->Continue(INTERRUPT); | 901 stack_guard->Continue(INTERRUPT); |
902 return isolate->StackOverflow(); | 902 return isolate->StackOverflow(); |
903 } | 903 } |
904 return isolate->heap()->undefined_value(); | 904 return isolate->heap()->undefined_value(); |
905 } | 905 } |
906 | 906 |
907 } } // namespace v8::internal | 907 } } // namespace v8::internal |
OLD | NEW |