dc3771970aa40691f591c1e391082386e1bfa270
[WebKit-https.git] / Source / JavaScriptCore / runtime / JSFunction.cpp
1 /*
2  *  Copyright (C) 1999-2002 Harri Porten (porten@kde.org)
3  *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
4  *  Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5  *  Copyright (C) 2007 Cameron Zwarich (cwzwarich@uwaterloo.ca)
6  *  Copyright (C) 2007 Maks Orlovich
7  *
8  *  This library is free software; you can redistribute it and/or
9  *  modify it under the terms of the GNU Library General Public
10  *  License as published by the Free Software Foundation; either
11  *  version 2 of the License, or (at your option) any later version.
12  *
13  *  This library is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  *  Library General Public License for more details.
17  *
18  *  You should have received a copy of the GNU Library General Public License
19  *  along with this library; see the file COPYING.LIB.  If not, write to
20  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  *  Boston, MA 02110-1301, USA.
22  *
23  */
24
25 #include "config.h"
26 #include "JSFunction.h"
27
28 #include "Arguments.h"
29 #include "CodeBlock.h"
30 #include "CommonIdentifiers.h"
31 #include "CallFrame.h"
32 #include "ExceptionHelpers.h"
33 #include "FunctionPrototype.h"
34 #include "GetterSetter.h"
35 #include "JSArray.h"
36 #include "JSBoundFunction.h"
37 #include "JSFunctionInlines.h"
38 #include "JSGlobalObject.h"
39 #include "JSNameScope.h" 
40 #include "JSNotAnObject.h"
41 #include "Interpreter.h"
42 #include "ObjectConstructor.h"
43 #include "ObjectPrototype.h"
44 #include "JSCInlines.h"
45 #include "Parser.h"
46 #include "PropertyNameArray.h"
47 #include "StackVisitor.h"
48
49 namespace JSC {
50
51 EncodedJSValue JSC_HOST_CALL callHostFunctionAsConstructor(ExecState* exec)
52 {
53     return throwVMError(exec, createNotAConstructorError(exec, exec->callee()));
54 }
55
56 const ClassInfo JSFunction::s_info = { "Function", &Base::s_info, 0, CREATE_METHOD_TABLE(JSFunction) };
57
58 bool JSFunction::isHostFunctionNonInline() const
59 {
60     return isHostFunction();
61 }
62
63 JSFunction* JSFunction::create(VM& vm, JSGlobalObject* globalObject, int length, const String& name, NativeFunction nativeFunction, Intrinsic intrinsic, NativeFunction nativeConstructor)
64 {
65     NativeExecutable* executable;
66 #if !ENABLE(JIT)
67     UNUSED_PARAM(intrinsic);
68 #else
69     if (intrinsic != NoIntrinsic && vm.canUseJIT()) {
70         ASSERT(nativeConstructor == callHostFunctionAsConstructor);
71         executable = vm.getHostFunction(nativeFunction, intrinsic);
72     } else
73 #endif
74         executable = vm.getHostFunction(nativeFunction, nativeConstructor);
75
76     JSFunction* function = new (NotNull, allocateCell<JSFunction>(vm.heap)) JSFunction(vm, globalObject, globalObject->functionStructure());
77     // Can't do this during initialization because getHostFunction might do a GC allocation.
78     function->finishCreation(vm, executable, length, name);
79     return function;
80 }
81
82 void JSFunction::destroy(JSCell* cell)
83 {
84     static_cast<JSFunction*>(cell)->JSFunction::~JSFunction();
85 }
86
87 JSFunction::JSFunction(VM& vm, JSGlobalObject* globalObject, Structure* structure)
88     : Base(vm, globalObject, structure)
89     , m_executable()
90     // We initialize blind so that changes to the prototype after function creation but before
91     // the optimizer kicks in don't disable optimizations. Once the optimizer kicks in, the
92     // watchpoint will start watching and any changes will both force deoptimization and disable
93     // future attempts to optimize. This is necessary because we are guaranteed that the
94     // allocation profile is changed exactly once prior to optimizations kicking in. We could be
95     // smarter and count the number of times the prototype is clobbered and only optimize if it
96     // was clobbered exactly once, but that seems like overkill. In almost all cases it will be
97     // clobbered once, and if it's clobbered more than once, that will probably only occur
98     // before we started optimizing, anyway.
99     , m_allocationProfileWatchpoint(ClearWatchpoint)
100 {
101 }
102
103 void JSFunction::finishCreation(VM& vm, NativeExecutable* executable, int length, const String& name)
104 {
105     Base::finishCreation(vm);
106     ASSERT(inherits(info()));
107     m_executable.set(vm, this, executable);
108     putDirect(vm, vm.propertyNames->name, jsString(&vm, name), DontDelete | ReadOnly | DontEnum);
109     putDirect(vm, vm.propertyNames->length, jsNumber(length), DontDelete | ReadOnly | DontEnum);
110 }
111
112 void JSFunction::addNameScopeIfNeeded(VM& vm)
113 {
114     FunctionExecutable* executable = jsCast<FunctionExecutable*>(m_executable.get());
115     if (!functionNameIsInScope(executable->name(), executable->functionMode()))
116         return;
117     if (!functionNameScopeIsDynamic(executable->usesEval(), executable->isStrictMode()))
118         return;
119     setScope(vm, JSNameScope::create(vm, scope()->globalObject(), executable->name(), this, ReadOnly | DontDelete, scope(), JSNameScope::FunctionNameScope));
120 }
121
122 JSFunction* JSFunction::createBuiltinFunction(VM& vm, FunctionExecutable* executable, JSGlobalObject* globalObject)
123 {
124     JSFunction* function = create(vm, executable, globalObject);
125     function->putDirect(vm, vm.propertyNames->name, jsString(&vm, executable->name().string()), DontDelete | ReadOnly | DontEnum);
126     function->putDirect(vm, vm.propertyNames->length, jsNumber(executable->parameterCount()), DontDelete | ReadOnly | DontEnum);
127     return function;
128 }
129
130 ObjectAllocationProfile* JSFunction::createAllocationProfile(ExecState* exec, size_t inlineCapacity)
131 {
132     VM& vm = exec->vm();
133     JSObject* prototype = jsDynamicCast<JSObject*>(get(exec, vm.propertyNames->prototype));
134     if (!prototype)
135         prototype = globalObject()->objectPrototype();
136     m_allocationProfile.initialize(globalObject()->vm(), this, prototype, inlineCapacity);
137     return &m_allocationProfile;
138 }
139
140 String JSFunction::name(ExecState* exec)
141 {
142     return get(exec, exec->vm().propertyNames->name).toWTFString(exec);
143 }
144
145 String JSFunction::displayName(ExecState* exec)
146 {
147     JSValue displayName = getDirect(exec->vm(), exec->vm().propertyNames->displayName);
148     
149     if (displayName && isJSString(displayName))
150         return asString(displayName)->tryGetValue();
151     
152     return String();
153 }
154
155 const String JSFunction::calculatedDisplayName(ExecState* exec)
156 {
157     const String explicitName = displayName(exec);
158     
159     if (!explicitName.isEmpty())
160         return explicitName;
161     
162     const String actualName = name(exec);
163     if (!actualName.isEmpty() || isHostOrBuiltinFunction())
164         return actualName;
165     
166     return jsExecutable()->inferredName().string();
167 }
168
169 const SourceCode* JSFunction::sourceCode() const
170 {
171     if (isHostOrBuiltinFunction())
172         return 0;
173     return &jsExecutable()->source();
174 }
175     
176 void JSFunction::visitChildren(JSCell* cell, SlotVisitor& visitor)
177 {
178     JSFunction* thisObject = jsCast<JSFunction*>(cell);
179     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
180     Base::visitChildren(thisObject, visitor);
181
182     visitor.append(&thisObject->m_executable);
183     thisObject->m_allocationProfile.visitAggregate(visitor);
184 }
185
186 CallType JSFunction::getCallData(JSCell* cell, CallData& callData)
187 {
188     JSFunction* thisObject = jsCast<JSFunction*>(cell);
189     if (thisObject->isHostFunction()) {
190         callData.native.function = thisObject->nativeFunction();
191         return CallTypeHost;
192     }
193     callData.js.functionExecutable = thisObject->jsExecutable();
194     callData.js.scope = thisObject->scope();
195     return CallTypeJS;
196 }
197
198 class RetrieveArgumentsFunctor {
199 public:
200     RetrieveArgumentsFunctor(JSFunction* functionObj)
201         : m_targetCallee(jsDynamicCast<JSObject*>(functionObj))
202         , m_result(jsNull())
203     {
204     }
205
206     JSValue result() const { return m_result; }
207
208     StackVisitor::Status operator()(StackVisitor& visitor)
209     {
210         JSObject* callee = visitor->callee();
211         if (callee != m_targetCallee)
212             return StackVisitor::Continue;
213
214         m_result = JSValue(visitor->createArguments());
215         return StackVisitor::Done;
216     }
217
218 private:
219     JSObject* m_targetCallee;
220     JSValue m_result;
221 };
222
223 static JSValue retrieveArguments(ExecState* exec, JSFunction* functionObj)
224 {
225     RetrieveArgumentsFunctor functor(functionObj);
226     exec->iterate(functor);
227     return functor.result();
228 }
229
230 EncodedJSValue JSFunction::argumentsGetter(ExecState* exec, JSObject* slotBase, EncodedJSValue, PropertyName)
231 {
232     JSFunction* thisObj = jsCast<JSFunction*>(slotBase);
233     ASSERT(!thisObj->isHostFunction());
234
235     return JSValue::encode(retrieveArguments(exec, thisObj));
236 }
237
238 class RetrieveCallerFunctionFunctor {
239 public:
240     RetrieveCallerFunctionFunctor(JSFunction* functionObj)
241         : m_targetCallee(jsDynamicCast<JSObject*>(functionObj))
242         , m_hasFoundFrame(false)
243         , m_hasSkippedToCallerFrame(false)
244         , m_result(jsNull())
245     {
246     }
247
248     JSValue result() const { return m_result; }
249
250     StackVisitor::Status operator()(StackVisitor& visitor)
251     {
252         JSObject* callee = visitor->callee();
253
254         if (callee && callee->inherits(JSBoundFunction::info()))
255             return StackVisitor::Continue;
256
257         if (!m_hasFoundFrame && (callee != m_targetCallee))
258             return StackVisitor::Continue;
259
260         m_hasFoundFrame = true;
261         if (!m_hasSkippedToCallerFrame) {
262             m_hasSkippedToCallerFrame = true;
263             return StackVisitor::Continue;
264         }
265
266         if (callee)
267             m_result = callee;
268         return StackVisitor::Done;
269     }
270
271 private:
272     JSObject* m_targetCallee;
273     bool m_hasFoundFrame;
274     bool m_hasSkippedToCallerFrame;
275     JSValue m_result;
276 };
277
278 static JSValue retrieveCallerFunction(ExecState* exec, JSFunction* functionObj)
279 {
280     RetrieveCallerFunctionFunctor functor(functionObj);
281     exec->iterate(functor);
282     return functor.result();
283 }
284
285 EncodedJSValue JSFunction::callerGetter(ExecState* exec, JSObject* slotBase, EncodedJSValue, PropertyName)
286 {
287     JSFunction* thisObj = jsCast<JSFunction*>(slotBase);
288     ASSERT(!thisObj->isHostFunction());
289     JSValue caller = retrieveCallerFunction(exec, thisObj);
290
291     // See ES5.1 15.3.5.4 - Function.caller may not be used to retrieve a strict caller.
292     if (!caller.isObject() || !asObject(caller)->inherits(JSFunction::info())) {
293         // It isn't a JSFunction, but if it is a JSCallee from a program or call eval, return null.
294         if (jsDynamicCast<JSCallee*>(caller))
295             return JSValue::encode(jsNull());
296         return JSValue::encode(caller);
297     }
298     JSFunction* function = jsCast<JSFunction*>(caller);
299     if (function->isHostOrBuiltinFunction() || !function->jsExecutable()->isStrictMode())
300         return JSValue::encode(caller);
301     return JSValue::encode(throwTypeError(exec, ASCIILiteral("Function.caller used to retrieve strict caller")));
302 }
303
304 EncodedJSValue JSFunction::lengthGetter(ExecState*, JSObject* slotBase, EncodedJSValue, PropertyName)
305 {
306     JSFunction* thisObj = jsCast<JSFunction*>(slotBase);
307     ASSERT(!thisObj->isHostFunction());
308     return JSValue::encode(jsNumber(thisObj->jsExecutable()->parameterCount()));
309 }
310
311 EncodedJSValue JSFunction::nameGetter(ExecState*, JSObject* slotBase, EncodedJSValue, PropertyName)
312 {
313     JSFunction* thisObj = jsCast<JSFunction*>(slotBase);
314     ASSERT(!thisObj->isHostFunction());
315     return JSValue::encode(thisObj->jsExecutable()->nameValue());
316 }
317
318 bool JSFunction::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
319 {
320     JSFunction* thisObject = jsCast<JSFunction*>(object);
321     if (thisObject->isHostOrBuiltinFunction())
322         return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
323
324     if (propertyName == exec->propertyNames().prototype) {
325         VM& vm = exec->vm();
326         unsigned attributes;
327         PropertyOffset offset = thisObject->getDirectOffset(vm, propertyName, attributes);
328         if (!isValidOffset(offset)) {
329             JSObject* prototype = constructEmptyObject(exec);
330             prototype->putDirect(vm, exec->propertyNames().constructor, thisObject, DontEnum);
331             thisObject->putDirect(vm, exec->propertyNames().prototype, prototype, DontDelete | DontEnum);
332             offset = thisObject->getDirectOffset(vm, exec->propertyNames().prototype, attributes);
333             ASSERT(isValidOffset(offset));
334         }
335
336         slot.setValue(thisObject, attributes, thisObject->getDirect(offset), offset);
337     }
338
339     if (propertyName == exec->propertyNames().arguments) {
340         if (thisObject->jsExecutable()->isStrictMode()) {
341             bool result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
342             if (!result) {
343                 thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec->vm()), DontDelete | DontEnum | Accessor);
344                 result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
345                 ASSERT(result);
346             }
347             return result;
348         }
349         slot.setCacheableCustom(thisObject, ReadOnly | DontEnum | DontDelete, argumentsGetter);
350         return true;
351     }
352
353     if (propertyName == exec->propertyNames().length) {
354         slot.setCacheableCustom(thisObject, ReadOnly | DontEnum | DontDelete, lengthGetter);
355         return true;
356     }
357
358     if (propertyName == exec->propertyNames().name) {
359         slot.setCacheableCustom(thisObject, ReadOnly | DontEnum | DontDelete, nameGetter);
360         return true;
361     }
362
363     if (propertyName == exec->propertyNames().caller) {
364         if (thisObject->jsExecutable()->isStrictMode()) {
365             bool result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
366             if (!result) {
367                 thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec->vm()), DontDelete | DontEnum | Accessor);
368                 result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
369                 ASSERT(result);
370             }
371             return result;
372         }
373         slot.setCacheableCustom(thisObject, ReadOnly | DontEnum | DontDelete, callerGetter);
374         return true;
375     }
376
377     return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
378 }
379
380 void JSFunction::getOwnNonIndexPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
381 {
382     JSFunction* thisObject = jsCast<JSFunction*>(object);
383     if (!thisObject->isHostOrBuiltinFunction() && shouldIncludeDontEnumProperties(mode)) {
384         VM& vm = exec->vm();
385         // Make sure prototype has been reified.
386         PropertySlot slot(thisObject);
387         thisObject->methodTable(vm)->getOwnPropertySlot(thisObject, exec, vm.propertyNames->prototype, slot);
388
389         propertyNames.add(vm.propertyNames->arguments);
390         propertyNames.add(vm.propertyNames->caller);
391         propertyNames.add(vm.propertyNames->length);
392         propertyNames.add(vm.propertyNames->name);
393     }
394     Base::getOwnNonIndexPropertyNames(thisObject, exec, propertyNames, mode);
395 }
396
397 void JSFunction::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
398 {
399     JSFunction* thisObject = jsCast<JSFunction*>(cell);
400     if (thisObject->isHostOrBuiltinFunction()) {
401         Base::put(thisObject, exec, propertyName, value, slot);
402         return;
403     }
404     if (propertyName == exec->propertyNames().prototype) {
405         // Make sure prototype has been reified, such that it can only be overwritten
406         // following the rules set out in ECMA-262 8.12.9.
407         PropertySlot slot(thisObject);
408         thisObject->methodTable(exec->vm())->getOwnPropertySlot(thisObject, exec, propertyName, slot);
409         thisObject->m_allocationProfile.clear();
410         thisObject->m_allocationProfileWatchpoint.fireAll("Store to prototype property of a function");
411         // Don't allow this to be cached, since a [[Put]] must clear m_allocationProfile.
412         PutPropertySlot dontCache(thisObject);
413         Base::put(thisObject, exec, propertyName, value, dontCache);
414         return;
415     }
416     if (thisObject->jsExecutable()->isStrictMode() && (propertyName == exec->propertyNames().arguments || propertyName == exec->propertyNames().caller)) {
417         // This will trigger the property to be reified, if this is not already the case!
418         bool okay = thisObject->hasProperty(exec, propertyName);
419         ASSERT_UNUSED(okay, okay);
420         Base::put(thisObject, exec, propertyName, value, slot);
421         return;
422     }
423     if (propertyName == exec->propertyNames().arguments || propertyName == exec->propertyNames().length || propertyName == exec->propertyNames().name || propertyName == exec->propertyNames().caller) {
424         if (slot.isStrictMode())
425             throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
426         return;
427     }
428     Base::put(thisObject, exec, propertyName, value, slot);
429 }
430
431 bool JSFunction::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName)
432 {
433     JSFunction* thisObject = jsCast<JSFunction*>(cell);
434     // For non-host functions, don't let these properties by deleted - except by DefineOwnProperty.
435     if (!thisObject->isHostOrBuiltinFunction() && !exec->vm().isInDefineOwnProperty()
436         && (propertyName == exec->propertyNames().arguments
437             || propertyName == exec->propertyNames().length
438             || propertyName == exec->propertyNames().name
439             || propertyName == exec->propertyNames().prototype
440             || propertyName == exec->propertyNames().caller))
441         return false;
442     return Base::deleteProperty(thisObject, exec, propertyName);
443 }
444
445 bool JSFunction::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName propertyName, const PropertyDescriptor& descriptor, bool throwException)
446 {
447     JSFunction* thisObject = jsCast<JSFunction*>(object);
448     if (thisObject->isHostOrBuiltinFunction())
449         return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException);
450
451     if (propertyName == exec->propertyNames().prototype) {
452         // Make sure prototype has been reified, such that it can only be overwritten
453         // following the rules set out in ECMA-262 8.12.9.
454         PropertySlot slot(thisObject);
455         thisObject->methodTable(exec->vm())->getOwnPropertySlot(thisObject, exec, propertyName, slot);
456         thisObject->m_allocationProfile.clear();
457         thisObject->m_allocationProfileWatchpoint.fireAll("Store to prototype property of a function");
458         return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException);
459     }
460
461     bool valueCheck;
462     if (propertyName == exec->propertyNames().arguments) {
463         if (thisObject->jsExecutable()->isStrictMode()) {
464             PropertySlot slot(thisObject);
465             if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot))
466                 thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec->vm()), DontDelete | DontEnum | Accessor);
467             return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException);
468         }
469         valueCheck = !descriptor.value() || sameValue(exec, descriptor.value(), retrieveArguments(exec, thisObject));
470     } else if (propertyName == exec->propertyNames().caller) {
471         if (thisObject->jsExecutable()->isStrictMode()) {
472             PropertySlot slot(thisObject);
473             if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot))
474                 thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec->vm()), DontDelete | DontEnum | Accessor);
475             return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException);
476         }
477         valueCheck = !descriptor.value() || sameValue(exec, descriptor.value(), retrieveCallerFunction(exec, thisObject));
478     } else if (propertyName == exec->propertyNames().length)
479         valueCheck = !descriptor.value() || sameValue(exec, descriptor.value(), jsNumber(thisObject->jsExecutable()->parameterCount()));
480     else if (propertyName == exec->propertyNames().name)
481         valueCheck = !descriptor.value() || sameValue(exec, descriptor.value(), thisObject->jsExecutable()->nameValue());
482     else
483         return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException);
484      
485     if (descriptor.configurablePresent() && descriptor.configurable()) {
486         if (throwException)
487             exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to configurable attribute of unconfigurable property.")));
488         return false;
489     }
490     if (descriptor.enumerablePresent() && descriptor.enumerable()) {
491         if (throwException)
492             exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to change enumerable attribute of unconfigurable property.")));
493         return false;
494     }
495     if (descriptor.isAccessorDescriptor()) {
496         if (throwException)
497             exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to change access mechanism for an unconfigurable property.")));
498         return false;
499     }
500     if (descriptor.writablePresent() && descriptor.writable()) {
501         if (throwException)
502             exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to change writable attribute of unconfigurable property.")));
503         return false;
504     }
505     if (!valueCheck) {
506         if (throwException)
507             exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to change value of a readonly property.")));
508         return false;
509     }
510     return true;
511 }
512
513 // ECMA 13.2.2 [[Construct]]
514 ConstructType JSFunction::getConstructData(JSCell* cell, ConstructData& constructData)
515 {
516     JSFunction* thisObject = jsCast<JSFunction*>(cell);
517     if (thisObject->isHostFunction()) {
518         constructData.native.function = thisObject->nativeConstructor();
519         return ConstructTypeHost;
520     }
521     constructData.js.functionExecutable = thisObject->jsExecutable();
522     constructData.js.scope = thisObject->scope();
523     return ConstructTypeJS;
524 }
525
526 String getCalculatedDisplayName(CallFrame* callFrame, JSObject* object)
527 {
528     if (JSFunction* function = jsDynamicCast<JSFunction*>(object))
529         return function->calculatedDisplayName(callFrame);
530     if (InternalFunction* function = jsDynamicCast<InternalFunction*>(object))
531         return function->calculatedDisplayName(callFrame);
532     return "";
533 }
534
535 } // namespace JSC