| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/accessors.h" | 5 #include "src/accessors.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/contexts.h" | 8 #include "src/contexts.h" |
| 9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
| 10 #include "src/execution.h" | 10 #include "src/execution.h" |
| (...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1322 // If caller is a built-in function and caller's caller is also built-in, | 1322 // If caller is a built-in function and caller's caller is also built-in, |
| 1323 // use that instead. | 1323 // use that instead. |
| 1324 JSFunction* potential_caller = caller; | 1324 JSFunction* potential_caller = caller; |
| 1325 while (potential_caller != NULL && potential_caller->shared()->IsBuiltin()) { | 1325 while (potential_caller != NULL && potential_caller->shared()->IsBuiltin()) { |
| 1326 caller = potential_caller; | 1326 caller = potential_caller; |
| 1327 potential_caller = it.next(); | 1327 potential_caller = it.next(); |
| 1328 } | 1328 } |
| 1329 if (!caller->shared()->native() && potential_caller != NULL) { | 1329 if (!caller->shared()->native() && potential_caller != NULL) { |
| 1330 caller = potential_caller; | 1330 caller = potential_caller; |
| 1331 } | 1331 } |
| 1332 // If caller is bound, return null. This is compatible with JSC, and |
| 1333 // allows us to make bound functions use the strict function map |
| 1334 // and its associated throwing caller and arguments. |
| 1335 if (caller->shared()->bound()) { |
| 1336 return MaybeHandle<JSFunction>(); |
| 1337 } |
| 1332 // Censor if the caller is not a sloppy mode function. | 1338 // Censor if the caller is not a sloppy mode function. |
| 1333 // Change from ES5, which used to throw, see: | 1339 // Change from ES5, which used to throw, see: |
| 1334 // https://bugs.ecmascript.org/show_bug.cgi?id=310 | 1340 // https://bugs.ecmascript.org/show_bug.cgi?id=310 |
| 1335 if (is_strict(caller->shared()->language_mode())) { | 1341 if (is_strict(caller->shared()->language_mode())) { |
| 1336 return MaybeHandle<JSFunction>(); | 1342 return MaybeHandle<JSFunction>(); |
| 1337 } | 1343 } |
| 1338 // Don't return caller from another security context. | 1344 // Don't return caller from another security context. |
| 1339 if (!AllowAccessToFunction(isolate->context(), caller)) { | 1345 if (!AllowAccessToFunction(isolate->context(), caller)) { |
| 1340 return MaybeHandle<JSFunction>(); | 1346 return MaybeHandle<JSFunction>(); |
| 1341 } | 1347 } |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1462 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 1468 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
| 1463 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 1469 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
| 1464 info->set_getter(*getter); | 1470 info->set_getter(*getter); |
| 1465 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 1471 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
| 1466 return info; | 1472 return info; |
| 1467 } | 1473 } |
| 1468 | 1474 |
| 1469 | 1475 |
| 1470 } // namespace internal | 1476 } // namespace internal |
| 1471 } // namespace v8 | 1477 } // namespace v8 |
| OLD | NEW |