Debian Codegraph @

src/3rdparty/javascriptcore/JavaScriptCore/runtime/Completion.cpp

raw symbols SCIP
1 /*
2 * Copyright (C) 1999-2001 Harri Porten ([email protected])
3 * Copyright (C) 2001 Peter Kelly ([email protected])
4 * Copyright (C) 2003, 2007 Apple Inc.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 *
21 */
22
23 #include "config.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/config.h`/
24 #include "Completion.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Completion.h`/
25
26 #include "CallFrame.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/CallFrame.h`/
27 #include "JSGlobalObject.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h`/
28 #include "JSLock.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSLock.h`/
29 #include "Interpreter.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.h`/
30 #include "Parser.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/parser/Parser.h`/
31 #include "Debugger.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h`/
32 #include <stdio.h>
33
34 namespace JSCcxx . . $ `<built-in>:463:9`! {
35
36 Completioncxx . . $ QTJSC/Completion# checkSyntaxcxx . . $ QTJSC/checkSyntax(f2f2cfe398780fc).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const SourceCodecxx . . $ QTJSC/SourceCode#& source)
37 {
38 JSLockcxx . . $ QTJSC/JSLock# lockcxx . . $ QTJSC/JSLock#JSLock(d2cb180e190a9680).(exec);
39 ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(exec->globalData().identifierTable == currentIdentifierTable());
40
41 RefPtrcxx . . $ RefPtr#<ProgramExecutablecxx . . $ QTJSC/ProgramExecutable#> program = ProgramExecutable::create(exec, source);
42 JSObjectcxx . . $ QTJSC/JSObject#* error = program->checkSyntax(exec);
43 if (error)
44 return Completion(Throwcxx . . $ QTJSC/Throw., error);
45
46 return Completioncxx . . $ QTJSC/Completion#(Normalcxx . . $ QTJSC/Normal.);
47 }
48
49 Completioncxx . . $ QTJSC/Completion# evaluatecxx . . $ QTJSC/evaluate(20feb6f8316b5685).(ExecStatecxx . . $ QTJSC/ExecState#* exec, ScopeChaincxx . . $ QTJSC/ScopeChain#& scopeChain, const SourceCodecxx . . $ QTJSC/SourceCode#& source, JSValuecxx . . $ QTJSC/JSValue# thisValue)
50 {
51 JSLockcxx . . $ QTJSC/JSLock# lockcxx . . $ QTJSC/JSLock#JSLock(d2cb180e190a9680).(exec);
52 ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(exec->globalData().identifierTable == currentIdentifierTable());
53
54 RefPtrcxx . . $ RefPtr#<ProgramExecutablecxx . . $ QTJSC/ProgramExecutable#> program = ProgramExecutable::create(exec, source);
55 JSObjectcxx . . $ QTJSC/JSObject#* error = program->compile(exec, scopeChain.nodecxx . . $ QTJSC/ScopeChain#node(7483ce9f56294eec).());
56 if (error)
57 return Completion(Throwcxx . . $ QTJSC/Throw., error);
58
59 JSObjectcxx . . $ QTJSC/JSObject#* thisObj = (!thisValue || thisValue.isUndefinedOrNullcxx . . $ QTJSC/JSValue#isUndefinedOrNull(50ce9a9e25b4a850).()) ? exec->dynamicGlobalObjectcxx . . $ QTJSC/ExecState#dynamicGlobalObject(4418983463e2bc6a).() : thisValue.toObjectcxx . . $ QTJSC/JSValue#toObject(8709ed4849a165ab).(exec);
60
61 JSValuecxx . . $ QTJSC/JSValue# exceptioncxx . . $ QTJSC/JSValue#JSValue(49f6e7a06ebc5aa8).;
62 JSValuecxx . . $ QTJSC/JSValue# result = exec->interpretercxx . . $ QTJSC/ExecState#interpreter(6574b75232d5177f).()->executecxx . . $ QTJSC/Interpreter#execute(7ce193c050309b77).(program.get(), exec, scopeChain.nodecxx . . $ QTJSC/ScopeChain#node(7483ce9f56294eec).(), thisObj, &exception);
63
64 if (exception) {
65 if (exception.isObjectcxx . . $ QTJSC/JSValue#isObject(50ce9a9e25b4a850).() && asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(exception)->isWatchdogExceptioncxx . . $ QTJSC/JSObject#isWatchdogException(50ce9a9e25b4a850).())
66 return Completioncxx . . $ QTJSC/Completion#Completion(7c7290f0f5fd1f62).(Interruptedcxx . . $ QTJSC/Interrupted., exception);
67 return Completioncxx . . $ QTJSC/Completion#Completion(7c7290f0f5fd1f62).(Throwcxx . . $ QTJSC/Throw., exception);
68 }
69 return Completioncxx . . $ QTJSC/Completion#Completion(7c7290f0f5fd1f62).(Normalcxx . . $ QTJSC/Normal., result);
70 }
71
72 } // namespace JSC