OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3721 */ | 3721 */ |
3722 void AllowCodeGenerationFromStrings(bool allow); | 3722 void AllowCodeGenerationFromStrings(bool allow); |
3723 | 3723 |
3724 /** | 3724 /** |
3725 * Returns true if code generation from strings is allowed for the context. | 3725 * Returns true if code generation from strings is allowed for the context. |
3726 * For more details see AllowCodeGenerationFromStrings(bool) documentation. | 3726 * For more details see AllowCodeGenerationFromStrings(bool) documentation. |
3727 */ | 3727 */ |
3728 bool IsCodeGenerationFromStringsAllowed(); | 3728 bool IsCodeGenerationFromStringsAllowed(); |
3729 | 3729 |
3730 /** | 3730 /** |
| 3731 * Sets the error description for the exception that is thrown when |
| 3732 * code generation from strings is not allowed and 'eval' or the 'Function' |
| 3733 * constructor are called. |
| 3734 */ |
| 3735 void SetErrorMessageForCodeGenerationFromStrings(Handle<String> message); |
| 3736 |
| 3737 /** |
3731 * Stack-allocated class which sets the execution context for all | 3738 * Stack-allocated class which sets the execution context for all |
3732 * operations executed within a local scope. | 3739 * operations executed within a local scope. |
3733 */ | 3740 */ |
3734 class Scope { | 3741 class Scope { |
3735 public: | 3742 public: |
3736 explicit inline Scope(Handle<Context> context) : context_(context) { | 3743 explicit inline Scope(Handle<Context> context) : context_(context) { |
3737 context_->Enter(); | 3744 context_->Enter(); |
3738 } | 3745 } |
3739 inline ~Scope() { context_->Exit(); } | 3746 inline ~Scope() { context_->Exit(); } |
3740 private: | 3747 private: |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4610 | 4617 |
4611 | 4618 |
4612 } // namespace v8 | 4619 } // namespace v8 |
4613 | 4620 |
4614 | 4621 |
4615 #undef V8EXPORT | 4622 #undef V8EXPORT |
4616 #undef TYPE_CHECK | 4623 #undef TYPE_CHECK |
4617 | 4624 |
4618 | 4625 |
4619 #endif // V8_H_ | 4626 #endif // V8_H_ |
OLD | NEW |