oliver@apple.com | 5930185 | 2010-10-11 19:12:29 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions |
| 6 | * are met: |
| 7 | * 1. Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * 2. Redistributions in binary form must reproduce the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer in the |
| 11 | * documentation and/or other materials provided with the distribution. |
| 12 | * |
| 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' |
| 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
| 15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS |
| 17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 23 | * THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | */ |
| 25 | |
ryanhaddad@apple.com | 22104f5 | 2016-09-28 17:08:17 +0000 | [diff] [blame] | 26 | #pragma once |
oliver@apple.com | 5930185 | 2010-10-11 19:12:29 +0000 | [diff] [blame] | 27 | |
ggaren@apple.com | bc3ae3f | 2012-08-29 17:13:50 +0000 | [diff] [blame] | 28 | #include "JSScope.h" |
oliver@apple.com | 5930185 | 2010-10-11 19:12:29 +0000 | [diff] [blame] | 29 | |
| 30 | namespace JSC { |
| 31 | |
utatane.tea@gmail.com | 64e3d77 | 2018-03-07 17:18:49 +0000 | [diff] [blame] | 32 | class StrictEvalActivation final : public JSScope { |
oliver@apple.com | 5930185 | 2010-10-11 19:12:29 +0000 | [diff] [blame] | 33 | public: |
utatane.tea@gmail.com | 64e3d77 | 2018-03-07 17:18:49 +0000 | [diff] [blame] | 34 | using Base = JSScope; |
commit-queue@webkit.org | 6c25c52 | 2011-08-09 20:46:17 +0000 | [diff] [blame] | 35 | |
msaboff@apple.com | cc305da | 2014-12-11 16:41:33 +0000 | [diff] [blame] | 36 | static StrictEvalActivation* create(ExecState* exec, JSScope* currentScope) |
commit-queue@webkit.org | ccbd2ba | 2011-07-28 04:59:12 +0000 | [diff] [blame] | 37 | { |
mark.lam@apple.com | 23e9624 | 2017-09-09 16:21:45 +0000 | [diff] [blame] | 38 | VM& vm = exec->vm(); |
| 39 | StrictEvalActivation* lexicalEnvironment = new (NotNull, allocateCell<StrictEvalActivation>(vm.heap)) StrictEvalActivation(exec, currentScope); |
| 40 | lexicalEnvironment->finishCreation(vm); |
oliver@apple.com | a7dfb4d | 2014-09-11 18:18:14 +0000 | [diff] [blame] | 41 | return lexicalEnvironment; |
commit-queue@webkit.org | ccbd2ba | 2011-07-28 04:59:12 +0000 | [diff] [blame] | 42 | } |
| 43 | |
barraclough@apple.com | 38d3c75 | 2012-05-12 00:39:43 +0000 | [diff] [blame] | 44 | static bool deleteProperty(JSCell*, ExecState*, PropertyName); |
barraclough@apple.com | 19afece | 2011-07-15 19:51:49 +0000 | [diff] [blame] | 45 | |
ggaren@apple.com | 9a9a4b5 | 2013-04-18 19:32:17 +0000 | [diff] [blame] | 46 | static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) |
barraclough@apple.com | 19afece | 2011-07-15 19:51:49 +0000 | [diff] [blame] | 47 | { |
utatane.tea@gmail.com | b0cf6ef | 2016-10-21 01:33:14 +0000 | [diff] [blame] | 48 | return Structure::create(vm, globalObject, prototype, TypeInfo(StrictEvalActivationType, StructureFlags), info()); |
barraclough@apple.com | 19afece | 2011-07-15 19:51:49 +0000 | [diff] [blame] | 49 | } |
| 50 | |
fpizlo@apple.com | 10ae2d0 | 2013-08-14 02:41:47 +0000 | [diff] [blame] | 51 | DECLARE_INFO; |
mhahnenberg@apple.com | 7feeec6 | 2011-10-06 17:42:50 +0000 | [diff] [blame] | 52 | |
commit-queue@webkit.org | ccbd2ba | 2011-07-28 04:59:12 +0000 | [diff] [blame] | 53 | private: |
msaboff@apple.com | cc305da | 2014-12-11 16:41:33 +0000 | [diff] [blame] | 54 | StrictEvalActivation(ExecState*, JSScope*); |
oliver@apple.com | 5930185 | 2010-10-11 19:12:29 +0000 | [diff] [blame] | 55 | }; |
| 56 | |
| 57 | } // namespace JSC |