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 } | |
1338 // Censor if the caller is not a sloppy mode function. | 1332 // Censor if the caller is not a sloppy mode function. |
1339 // Change from ES5, which used to throw, see: | 1333 // Change from ES5, which used to throw, see: |
1340 // https://bugs.ecmascript.org/show_bug.cgi?id=310 | 1334 // https://bugs.ecmascript.org/show_bug.cgi?id=310 |
1341 if (is_strict(caller->shared()->language_mode())) { | 1335 if (is_strict(caller->shared()->language_mode())) { |
1342 return MaybeHandle<JSFunction>(); | 1336 return MaybeHandle<JSFunction>(); |
1343 } | 1337 } |
1344 // Don't return caller from another security context. | 1338 // Don't return caller from another security context. |
1345 if (!AllowAccessToFunction(isolate->context(), caller)) { | 1339 if (!AllowAccessToFunction(isolate->context(), caller)) { |
1346 return MaybeHandle<JSFunction>(); | 1340 return MaybeHandle<JSFunction>(); |
1347 } | 1341 } |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1468 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 1462 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
1469 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 1463 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
1470 info->set_getter(*getter); | 1464 info->set_getter(*getter); |
1471 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 1465 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
1472 return info; | 1466 return info; |
1473 } | 1467 } |
1474 | 1468 |
1475 | 1469 |
1476 } // namespace internal | 1470 } // namespace internal |
1477 } // namespace v8 | 1471 } // namespace v8 |
OLD | NEW |