本文整理汇总了C++中FunctionExecutable::isStrictMode方法的典型用法代码示例。如果您正苦于以下问题:C++ FunctionExecutable::isStrictMode方法的具体用法?C++ FunctionExecutable::isStrictMode怎么用?C++ FunctionExecutable::isStrictMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionExecutable
的用法示例。
在下文中一共展示了FunctionExecutable::isStrictMode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getOwnPropertySlot
bool ClonedArguments::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName ident, PropertySlot& slot)
{
ClonedArguments* thisObject = jsCast<ClonedArguments*>(object);
VM& vm = exec->vm();
if (!thisObject->specialsMaterialized()) {
FunctionExecutable* executable = jsCast<FunctionExecutable*>(thisObject->m_callee->executable());
bool isStrictMode = executable->isStrictMode();
if (ident == vm.propertyNames->callee) {
if (isStrictMode) {
slot.setGetterSlot(thisObject, DontDelete | DontEnum | Accessor, thisObject->globalObject()->throwTypeErrorArgumentsCalleeAndCallerGetterSetter());
return true;
}
slot.setValue(thisObject, 0, thisObject->m_callee.get());
return true;
}
if (ident == vm.propertyNames->iteratorSymbol) {
slot.setValue(thisObject, DontEnum, thisObject->globalObject()->arrayProtoValuesFunction());
return true;
}
}
return Base::getOwnPropertySlot(thisObject, exec, ident, slot);
}
示例2: addNameScopeIfNeeded
void JSFunction::addNameScopeIfNeeded(VM& vm)
{
FunctionExecutable* executable = jsCast<FunctionExecutable*>(m_executable.get());
if (!functionNameIsInScope(executable->name(), executable->functionMode()))
return;
if (!functionNameScopeIsDynamic(executable->usesEval(), executable->isStrictMode()))
return;
m_scope.set(vm, this, JSNameScope::create(vm, m_scope->globalObject(), executable->name(), this, ReadOnly | DontDelete, m_scope.get()));
}
示例3: materializeSpecials
void ClonedArguments::materializeSpecials(ExecState* exec)
{
RELEASE_ASSERT(!specialsMaterialized());
VM& vm = exec->vm();
FunctionExecutable* executable = jsCast<FunctionExecutable*>(m_callee->executable());
bool isStrictMode = executable->isStrictMode();
if (isStrictMode)
putDirectAccessor(exec, vm.propertyNames->callee, globalObject()->throwTypeErrorArgumentsCalleeAndCallerGetterSetter(), DontDelete | DontEnum | Accessor);
else
putDirect(vm, vm.propertyNames->callee, JSValue(m_callee.get()));
putDirect(vm, vm.propertyNames->iteratorSymbol, globalObject()->arrayProtoValuesFunction(), DontEnum);
m_callee.clear();
}