blob: 2be09f5dd95a4bb493f39975828ad5b735d85e5a [file] [log] [blame]
oliver@apple.com59301852010-10-11 19:12:29 +00001/*
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.com22104f52016-09-28 17:08:17 +000026#pragma once
oliver@apple.com59301852010-10-11 19:12:29 +000027
ggaren@apple.combc3ae3f2012-08-29 17:13:50 +000028#include "JSScope.h"
oliver@apple.com59301852010-10-11 19:12:29 +000029
30namespace JSC {
31
utatane.tea@gmail.com64e3d772018-03-07 17:18:49 +000032class StrictEvalActivation final : public JSScope {
oliver@apple.com59301852010-10-11 19:12:29 +000033public:
utatane.tea@gmail.com64e3d772018-03-07 17:18:49 +000034 using Base = JSScope;
commit-queue@webkit.org6c25c522011-08-09 20:46:17 +000035
msaboff@apple.comcc305da2014-12-11 16:41:33 +000036 static StrictEvalActivation* create(ExecState* exec, JSScope* currentScope)
commit-queue@webkit.orgccbd2ba2011-07-28 04:59:12 +000037 {
mark.lam@apple.com23e96242017-09-09 16:21:45 +000038 VM& vm = exec->vm();
39 StrictEvalActivation* lexicalEnvironment = new (NotNull, allocateCell<StrictEvalActivation>(vm.heap)) StrictEvalActivation(exec, currentScope);
40 lexicalEnvironment->finishCreation(vm);
oliver@apple.coma7dfb4d2014-09-11 18:18:14 +000041 return lexicalEnvironment;
commit-queue@webkit.orgccbd2ba2011-07-28 04:59:12 +000042 }
43
barraclough@apple.com38d3c752012-05-12 00:39:43 +000044 static bool deleteProperty(JSCell*, ExecState*, PropertyName);
barraclough@apple.com19afece2011-07-15 19:51:49 +000045
ggaren@apple.com9a9a4b52013-04-18 19:32:17 +000046 static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
barraclough@apple.com19afece2011-07-15 19:51:49 +000047 {
utatane.tea@gmail.comb0cf6ef2016-10-21 01:33:14 +000048 return Structure::create(vm, globalObject, prototype, TypeInfo(StrictEvalActivationType, StructureFlags), info());
barraclough@apple.com19afece2011-07-15 19:51:49 +000049 }
50
fpizlo@apple.com10ae2d02013-08-14 02:41:47 +000051 DECLARE_INFO;
mhahnenberg@apple.com7feeec62011-10-06 17:42:50 +000052
commit-queue@webkit.orgccbd2ba2011-07-28 04:59:12 +000053private:
msaboff@apple.comcc305da2014-12-11 16:41:33 +000054 StrictEvalActivation(ExecState*, JSScope*);
oliver@apple.com59301852010-10-11 19:12:29 +000055};
56
57} // namespace JSC