blob: 13157f68af62656cc440168677c389a884f8228c [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
26#ifndef StrictEvalActivation_h
27#define StrictEvalActivation_h
28
ggaren@apple.combc3ae3f2012-08-29 17:13:50 +000029#include "JSScope.h"
oliver@apple.com59301852010-10-11 19:12:29 +000030
31namespace JSC {
32
ggaren@apple.combc3ae3f2012-08-29 17:13:50 +000033class StrictEvalActivation : public JSScope {
oliver@apple.com59301852010-10-11 19:12:29 +000034public:
ggaren@apple.combc3ae3f2012-08-29 17:13:50 +000035 typedef JSScope Base;
akling@apple.com4b9e0002015-04-13 19:12:48 +000036 static const unsigned StructureFlags = Base::StructureFlags | IsEnvironmentRecord;
commit-queue@webkit.org6c25c522011-08-09 20:46:17 +000037
msaboff@apple.comcc305da2014-12-11 16:41:33 +000038 static StrictEvalActivation* create(ExecState* exec, JSScope* currentScope)
commit-queue@webkit.orgccbd2ba2011-07-28 04:59:12 +000039 {
msaboff@apple.comcc305da2014-12-11 16:41:33 +000040 StrictEvalActivation* lexicalEnvironment = new (NotNull, allocateCell<StrictEvalActivation>(*exec->heap())) StrictEvalActivation(exec, currentScope);
oliver@apple.coma7dfb4d2014-09-11 18:18:14 +000041 lexicalEnvironment->finishCreation(exec->vm());
42 return lexicalEnvironment;
commit-queue@webkit.orgccbd2ba2011-07-28 04:59:12 +000043 }
44
barraclough@apple.com38d3c752012-05-12 00:39:43 +000045 static bool deleteProperty(JSCell*, ExecState*, PropertyName);
oliver@apple.come2fe4ce2013-07-25 03:59:41 +000046 static JSValue toThis(JSCell*, ExecState*, ECMAMode);
barraclough@apple.com19afece2011-07-15 19:51:49 +000047
ggaren@apple.com9a9a4b52013-04-18 19:32:17 +000048 static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
barraclough@apple.com19afece2011-07-15 19:51:49 +000049 {
fpizlo@apple.com10ae2d02013-08-14 02:41:47 +000050 return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
barraclough@apple.com19afece2011-07-15 19:51:49 +000051 }
52
fpizlo@apple.com10ae2d02013-08-14 02:41:47 +000053 DECLARE_INFO;
mhahnenberg@apple.com7feeec62011-10-06 17:42:50 +000054
commit-queue@webkit.orgccbd2ba2011-07-28 04:59:12 +000055private:
msaboff@apple.comcc305da2014-12-11 16:41:33 +000056 StrictEvalActivation(ExecState*, JSScope*);
oliver@apple.com59301852010-10-11 19:12:29 +000057};
58
59} // namespace JSC
60
61#endif // StrictEvalActivation_h