当前位置: 首页>>代码示例>>C++>>正文


C++ FunctionExecutable::isStrictMode方法代码示例

本文整理汇总了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);
}
开发者ID:,项目名称:,代码行数:26,代码来源:

示例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()));
}
开发者ID:MYSHLIFE,项目名称:webkit,代码行数:9,代码来源:JSFunction.cpp

示例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();
}
开发者ID:,项目名称:,代码行数:17,代码来源:


注:本文中的FunctionExecutable::isStrictMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。