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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/contexts.h" | 10 #include "src/contexts.h" |
(...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1405 } | 1405 } |
1406 // If caller is bound, return null. This is compatible with JSC, and | 1406 // If caller is bound, return null. This is compatible with JSC, and |
1407 // allows us to make bound functions use the strict function map | 1407 // allows us to make bound functions use the strict function map |
1408 // and its associated throwing caller and arguments. | 1408 // and its associated throwing caller and arguments. |
1409 if (caller->shared()->bound()) { | 1409 if (caller->shared()->bound()) { |
1410 return MaybeHandle<JSFunction>(); | 1410 return MaybeHandle<JSFunction>(); |
1411 } | 1411 } |
1412 // Censor if the caller is not a sloppy mode function. | 1412 // Censor if the caller is not a sloppy mode function. |
1413 // Change from ES5, which used to throw, see: | 1413 // Change from ES5, which used to throw, see: |
1414 // https://bugs.ecmascript.org/show_bug.cgi?id=310 | 1414 // https://bugs.ecmascript.org/show_bug.cgi?id=310 |
1415 if (caller->shared()->strict_mode() == STRICT) { | 1415 if (is_strict(caller->shared()->language_mode())) { |
1416 return MaybeHandle<JSFunction>(); | 1416 return MaybeHandle<JSFunction>(); |
1417 } | 1417 } |
1418 // Don't return caller from another security context. | 1418 // Don't return caller from another security context. |
1419 if (!AllowAccessToFunction(isolate->context(), caller)) { | 1419 if (!AllowAccessToFunction(isolate->context(), caller)) { |
1420 return MaybeHandle<JSFunction>(); | 1420 return MaybeHandle<JSFunction>(); |
1421 } | 1421 } |
1422 return Handle<JSFunction>(caller); | 1422 return Handle<JSFunction>(caller); |
1423 } | 1423 } |
1424 | 1424 |
1425 | 1425 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1534 info->set_data(Smi::FromInt(index)); | 1534 info->set_data(Smi::FromInt(index)); |
1535 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 1535 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
1536 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 1536 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
1537 info->set_getter(*getter); | 1537 info->set_getter(*getter); |
1538 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 1538 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
1539 return info; | 1539 return info; |
1540 } | 1540 } |
1541 | 1541 |
1542 | 1542 |
1543 } } // namespace v8::internal | 1543 } } // namespace v8::internal |
OLD | NEW |