您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetScriptContext函数代码示例

51自学网 2021-06-01 21:14:39
  C++
这篇教程C++ GetScriptContext函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetScriptContext函数的典型用法代码示例。如果您正苦于以下问题:C++ GetScriptContext函数的具体用法?C++ GetScriptContext怎么用?C++ GetScriptContext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetScriptContext函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetScriptContext

    void RegexPattern::Finalize(bool isShutdown)    {        if(isShutdown)            return;        const auto scriptContext = GetScriptContext();        if(!scriptContext)            return;#if DBG        if(!isLiteral && !scriptContext->IsClosed())        {            const auto source = GetSource();            RegexPattern *p;            Assert(                !GetScriptContext()->GetDynamicRegexMap()->TryGetValue(                    RegexKey(source.GetBuffer(), source.GetLength(), GetFlags()),                    &p) || ( source.GetLength() == 0 ) ||                p != this);        }#endif        if(isShallowClone)            return;        rep.unified.program->FreeBody(scriptContext->RegexAllocator());    }
开发者ID:EdMaurer,项目名称:ChakraCore,代码行数:27,


示例2: switch

    BOOL JavascriptRegExpConstructor::DeleteProperty(PropertyId propertyId, PropertyOperationFlags flags)    {        switch (propertyId)        {            // all globals are 'fNoDelete' in V5.8        case PropertyIds::input:        case PropertyIds::$_:        case PropertyIds::lastMatch:        case PropertyIds::$Ampersand:        case PropertyIds::lastParen:        case PropertyIds::$Plus:        case PropertyIds::leftContext:        case PropertyIds::$BackTick:        case PropertyIds::rightContext:        case PropertyIds::$Tick:        case PropertyIds::$1:        case PropertyIds::$2:        case PropertyIds::$3:        case PropertyIds::$4:        case PropertyIds::$5:        case PropertyIds::$6:        case PropertyIds::$7:        case PropertyIds::$8:        case PropertyIds::$9:        case PropertyIds::index:            JavascriptError::ThrowCantDeleteIfStrictMode(flags, GetScriptContext(), GetScriptContext()->GetPropertyName(propertyId)->GetBuffer());            return false;        default:            return JavascriptFunction::DeleteProperty(propertyId, flags);        }    }
开发者ID:bjjones,项目名称:ChakraCore,代码行数:32,


示例3: ArrayBufferBase

    SharedArrayBuffer::SharedArrayBuffer(uint32 length, DynamicType * type, Allocator allocator) :        ArrayBufferBase(type), sharedContents(nullptr)    {        BYTE * buffer = nullptr;        if (length > MaxSharedArrayBufferLength)        {            JavascriptError::ThrowTypeError(GetScriptContext(), JSERR_FunctionArgument_Invalid);        }        else if (length > 0)        {            Recycler* recycler = GetType()->GetLibrary()->GetRecycler();            if (recycler->ReportExternalMemoryAllocation(length))            {                buffer = (BYTE*)allocator(length);                if (buffer == nullptr)                {                    recycler->ReportExternalMemoryFree(length);                }            }            if (buffer == nullptr)            {                recycler->CollectNow<CollectOnTypedArrayAllocation>();                if (recycler->ReportExternalMemoryAllocation(length))                {                    buffer = (BYTE*)allocator(length);                    if (buffer == nullptr)                    {                        recycler->ReportExternalMemoryFailure(length);                    }                }                else                {                    JavascriptError::ThrowOutOfMemoryError(GetScriptContext());                }            }            if (buffer != nullptr)            {                ZeroMemory(buffer, length);                sharedContents = HeapNew(SharedContents, buffer, length);                if (sharedContents == nullptr)                {                    recycler->ReportExternalMemoryFailure(length);                    // What else could we do?                    JavascriptError::ThrowOutOfMemoryError(GetScriptContext());                }#if DBG                sharedContents->AddAgent((DWORD_PTR)GetScriptContext());#endif            }        }    }
开发者ID:sankha93,项目名称:ChakraCore,代码行数:56,


示例4: GetScriptContext

 void ArrayObject::ThrowItemNotConfigurableError(PropertyId propId /*= Constants::NoProperty*/) {     ScriptContext* scriptContext = GetScriptContext();     JavascriptError::ThrowTypeError(scriptContext, JSERR_DefineProperty_NotConfigurable,         propId != Constants::NoProperty ?             scriptContext->GetThreadContext()->GetPropertyName(propId)->GetBuffer() : nullptr); }
开发者ID:muh00mad,项目名称:ChakraCore,代码行数:7,


示例5: GetScriptContext

    BOOL JavascriptStringObject::GetProperty(Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext)    {        BOOL result;        if (GetPropertyBuiltIns(propertyId, value, requestContext, &result))        {            return result;        }        if (DynamicObject::GetProperty(originalInstance, propertyId, value, info, requestContext))        {            return true;        }        // For NumericPropertyIds check that index is less than JavascriptString length        ScriptContext*scriptContext = GetScriptContext();        uint32 index;        if (scriptContext->IsNumericPropertyId(propertyId, &index))        {            JavascriptString* str = JavascriptString::FromVar(CrossSite::MarshalVar(requestContext, this->InternalUnwrap()));            return str->GetItemAt(index, value);        }        *value = requestContext->GetMissingPropertyResult();        return false;    }
开发者ID:Rastaban,项目名称:ChakraCore,代码行数:25,


示例6: GetScriptContext

    PropertyQueryFlags JavascriptStringObject::GetPropertyQuery(Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext)    {        BOOL result;        if (GetPropertyBuiltIns(propertyId, value, requestContext, &result))        {            return JavascriptConversion::BooleanToPropertyQueryFlags(result);        }        if (JavascriptConversion::PropertyQueryFlagsToBoolean(DynamicObject::GetPropertyQuery(originalInstance, propertyId, value, info, requestContext)))        {            return PropertyQueryFlags::Property_Found;        }        // For NumericPropertyIds check that index is less than JavascriptString length        ScriptContext*scriptContext = GetScriptContext();        uint32 index;        if (scriptContext->IsNumericPropertyId(propertyId, &index))        {            JavascriptString* str = this->InternalUnwrap();            str = JavascriptString::FromVar(CrossSite::MarshalVar(requestContext, str, scriptContext));            return JavascriptConversion::BooleanToPropertyQueryFlags(str->GetItemAt(index, value));        }        *value = requestContext->GetMissingPropertyResult();        return PropertyQueryFlags::Property_NotFound;    }
开发者ID:raghujayan,项目名称:ChakraCore,代码行数:27,


示例7: Assert

    BOOL ForInObjectEnumerator::GetCurrentEnumerator()    {        Assert(object);        ScriptContext* scriptContext = GetScriptContext();        if (VirtualTableInfo<DynamicObject>::HasVirtualTable(object))        {            DynamicObject* dynamicObject = (DynamicObject*)object;            if (!dynamicObject->GetTypeHandler()->EnsureObjectReady(dynamicObject))            {                return false;            }            dynamicObject->GetDynamicType()->PrepareForTypeSnapshotEnumeration();            embeddedEnumerator.Initialize(dynamicObject, true);            currentEnumerator = &embeddedEnumerator;            return true;        }        if (!object->GetEnumerator(TRUE /*enumNonEnumerable*/, (Var *)&currentEnumerator, scriptContext, true /*preferSnapshotSemantics */, enumSymbols))        {            currentEnumerator = scriptContext->GetLibrary()->GetNullEnumerator();            return false;        }        return true;    }
开发者ID:digitalinfinity,项目名称:ChakraCore,代码行数:25,


示例8: GetLdElemInlineCache

    PolymorphicInlineCache * PropertyString::CreateBiggerPolymorphicInlineCache(bool isLdElem)    {        PolymorphicInlineCache * polymorphicInlineCache = isLdElem ? GetLdElemInlineCache() : GetStElemInlineCache();        Assert(polymorphicInlineCache && polymorphicInlineCache->CanAllocateBigger());        uint16 polymorphicInlineCacheSize = polymorphicInlineCache->GetSize();        uint16 newPolymorphicInlineCacheSize = PolymorphicInlineCache::GetNextSize(polymorphicInlineCacheSize);        Assert(newPolymorphicInlineCacheSize > polymorphicInlineCacheSize);        PolymorphicInlineCache * newPolymorphicInlineCache = ScriptContextPolymorphicInlineCache::New(newPolymorphicInlineCacheSize, GetLibrary());        polymorphicInlineCache->CopyTo(this->propertyRecord->GetPropertyId(), GetScriptContext(), newPolymorphicInlineCache);        if (isLdElem)        {            this->ldElemInlineCache = newPolymorphicInlineCache;        }        else        {            this->stElemInlineCache = newPolymorphicInlineCache;        }#ifdef ENABLE_DEBUG_CONFIG_OPTIONS        if (PHASE_VERBOSE_TRACE1(Js::PolymorphicInlineCachePhase) || PHASE_TRACE1(PropertyStringCachePhase))        {            Output::Print(_u("PropertyString '%s' : Bigger PIC, oldSize = %d, newSize = %d/n"), GetString(), polymorphicInlineCacheSize, newPolymorphicInlineCacheSize);        }#endif        return newPolymorphicInlineCache;    }
开发者ID:litian2025,项目名称:ChakraCore,代码行数:25,


示例9: propertyDescriptor

 BOOL ModuleNamespace::FindNextProperty(BigPropertyIndex& index, JavascriptString** propertyString, PropertyId* propertyId, PropertyAttributes* attributes) const {     if (index < propertyMap->Count())     {         SimpleDictionaryPropertyDescriptor<BigPropertyIndex> propertyDescriptor(propertyMap->GetValueAt(index));         Assert(propertyDescriptor.Attributes == PropertyModuleNamespaceDefault);         const PropertyRecord* propertyRecord = propertyMap->GetKeyAt(index);         *propertyId = propertyRecord->GetPropertyId();         if (propertyString != nullptr)         {             *propertyString = GetScriptContext()->GetPropertyString(*propertyId);         }         if (attributes != nullptr)         {             *attributes = propertyDescriptor.Attributes;         }         return TRUE;     }     else     {         *propertyId = Constants::NoProperty;         if (propertyString != nullptr)         {             *propertyString = nullptr;         }     }     return FALSE; }
开发者ID:ashleygwilliams,项目名称:ChakraCore,代码行数:28,


示例10: GetScriptContext

 // We will make sure the iterator will iterate through the exported properties in sorted order. // There is no such requirement for enumerator (forin). ListForListIterator* ModuleNamespace::EnsureSortedExportedNames() {     if (sortedExportedNames == nullptr)     {         ExportedNames* exportedNames = moduleRecord->GetExportedNames(nullptr);         ScriptContext* scriptContext = GetScriptContext();         sortedExportedNames = ListForListIterator::New(scriptContext->GetRecycler());         exportedNames->Map([&](PropertyId propertyId) {             JavascriptString* propertyString = scriptContext->GetPropertyString(propertyId);             sortedExportedNames->Add(propertyString);         });         sortedExportedNames->Sort([](void* context, const void* left, const void* right) ->int {             JavascriptString** leftString = (JavascriptString**) (left);             JavascriptString** rightString = (JavascriptString**) (right);             if (JavascriptString::LessThan(*leftString, *rightString))             {                 return -1;             }             if (JavascriptString::LessThan(*rightString, *leftString))             {                 return 1;             }             return 0;         }, nullptr);     }     return sortedExportedNames; }
开发者ID:ashleygwilliams,项目名称:ChakraCore,代码行数:29,


示例11: ENTER_PINNED_SCOPE

 BOOL JavascriptNumberObject::GetDiagValueString(StringBuilder<ArenaAllocator>* stringBuilder, ScriptContext* requestContext) {     ENTER_PINNED_SCOPE(JavascriptString, valueStr);     valueStr = JavascriptNumber::ToStringRadix10(this->GetValue(), GetScriptContext());     stringBuilder->Append(valueStr->GetString(), valueStr->GetLength());     LEAVE_PINNED_SCOPE();     return TRUE; }
开发者ID:AlexElting,项目名称:ChakraCore,代码行数:8,


示例12: GetScriptContext

 void JavascriptSet::Add(Var value) {     if (!set->ContainsKey(value))     {         SetDataNode* node = list.Append(value, GetScriptContext()->GetRecycler());         set->Add(value, node);     } }
开发者ID:thiagolimaa,项目名称:ChakraCore,代码行数:8,


示例13: Init

 BOOL ModuleNamespaceEnumerator::Init() {     if (!nsObject->DynamicObject::GetEnumerator(&symbolEnumerator, flags, GetScriptContext()))     {         return FALSE;     }     nonLocalMap = nsObject->GetUnambiguousNonLocalExports();     Reset();     return TRUE; }
开发者ID:dilijev,项目名称:ChakraCore,代码行数:10,


示例14:

    bool ES5Array::GetPropertyBuiltIns(PropertyId propertyId, Var* value, BOOL* result)    {        if (propertyId == PropertyIds::length)        {            *value = JavascriptNumber::ToVar(this->GetLength(), GetScriptContext());            *result = true;            return true;        }        return false;    }
开发者ID:Rastaban,项目名称:ChakraCore,代码行数:11,


示例15: InitializeCurrentEnumerator

 BOOL ForInObjectEnumerator::InitializeCurrentEnumerator(RecyclableObject * object, ForInCache * forInCache) {     EnumeratorFlags flags = enumerator.GetFlags();     RecyclableObject * prototype = object->GetPrototype();     if (prototype == nullptr || prototype->GetTypeId() == TypeIds_Null)     {         // If this is the last object on the prototype chain, we don't need to get the non-enumerable properties any more to track shadowing         flags &= ~EnumeratorFlags::EnumNonEnumerable;     }     return InitializeCurrentEnumerator(object, flags, GetScriptContext(), forInCache); }
开发者ID:litian2025,项目名称:ChakraCore,代码行数:11,


示例16: ArrayBufferBase

    SharedArrayBuffer::SharedArrayBuffer(SharedContents * contents, DynamicType * type) :        ArrayBufferBase(type), sharedContents(nullptr)    {        if (contents == nullptr || contents->bufferLength > MaxSharedArrayBufferLength)        {            JavascriptError::ThrowTypeError(GetScriptContext(), JSERR_FunctionArgument_Invalid);        }        if (contents->AddRef() > 1)        {            sharedContents = contents;        }        else         {            Js::Throw::FatalInternalError();        }#if DBG        sharedContents->AddAgent((DWORD_PTR)GetScriptContext());#endif    }
开发者ID:sunnyeo,项目名称:ChakraCore,代码行数:20,


示例17: GetScriptContext

 ArrayObject* DynamicObject::EnsureObjectArray() {     if (!HasObjectArray())     {         ScriptContext* scriptContext = GetScriptContext();         ArrayObject* objArray = scriptContext->GetLibrary()->CreateArray(0, SparseArraySegmentBase::SMALL_CHUNK_SIZE);         SetObjectArray(objArray);     }     Assert(HasObjectArray());     return GetObjectArrayOrFlagsAsArray(); }
开发者ID:JefferyQ,项目名称:spidernode,代码行数:11,


示例18: GetLibrary

 Var ModuleNamespace::GetNextProperty(BigPropertyIndex& index) {     PropertyId propertyId;     Var result = GetLibrary()->GetUndefined();     BOOL retVal = FALSE;     if (this->FindNextProperty(index, nullptr, &propertyId, nullptr))     {         retVal = this->GetProperty(this, propertyId, &result, nullptr, GetScriptContext());         Assert(retVal);     }     return result; }
开发者ID:ashleygwilliams,项目名称:ChakraCore,代码行数:12,


示例19: GetScriptContext

    PropertyQueryFlags HeapArgumentsObject::HasPropertyQuery(PropertyId id, _Inout_opt_ PropertyValueInfo* info)    {        ScriptContext *scriptContext = GetScriptContext();        // Try to get a numbered property that maps to an actual argument.        uint32 index;        if (scriptContext->IsNumericPropertyId(id, &index) && index < this->HeapArgumentsObject::GetNumberOfArguments())        {            return HeapArgumentsObject::HasItemQuery(index);        }        return DynamicObject::HasPropertyQuery(id, info);    }
开发者ID:muh00mad,项目名称:ChakraCore,代码行数:13,


示例20: Assert

    Var DiagNativeStackFrame::CreateHeapArguments()    {        // We would be creating the arguments object if there is no default arguments object present.        Assert(GetArgumentsObject() == NULL);        CallInfo const * callInfo  = (CallInfo const *)&(((void **)m_stackAddr)[JavascriptFunctionArgIndex_CallInfo]);        // At the least we will have 'this' by default.        Assert(callInfo->Count > 0);        // Get the passed parameter's position (which is starting from 'this')        Var * inParams = (Var *)&(((void **)m_stackAddr)[JavascriptFunctionArgIndex_This]);        return JavascriptOperators::LoadHeapArguments(                                        m_function,                                        callInfo->Count - 1,                                        &inParams[1],                                        GetScriptContext()->GetLibrary()->GetNull(),                                        (PropertyId*)GetScriptContext()->GetLibrary()->GetNull(),                                        GetScriptContext(),                                        /* formalsAreLetDecls */ false);    }
开发者ID:EdwardBetts,项目名称:spidernode,代码行数:22,


示例21: DebugOnly

    JavascriptWeakMap::WeakMapKeyMap* JavascriptWeakMap::AddWeakMapKeyMapToKey(DynamicObject* key)    {        // The internal property may exist on an object that has had DynamicObject::ResetObject called on itself.        // In that case the value stored in the property slot should be null.        DebugOnly(Var unused = nullptr);        Assert(!key->GetInternalProperty(key, InternalPropertyIds::WeakMapKeyMap, &unused, nullptr, nullptr) || unused == nullptr);        WeakMapKeyMap* weakMapKeyData = RecyclerNew(GetScriptContext()->GetRecycler(), WeakMapKeyMap, GetScriptContext()->GetRecycler());        BOOL success = key->SetInternalProperty(InternalPropertyIds::WeakMapKeyMap, weakMapKeyData, PropertyOperation_Force, nullptr);        Assert(success);        return weakMapKeyData;    }
开发者ID:AlexElting,项目名称:ChakraCore,代码行数:13,


示例22: Assert

    BOOL ForInObjectEnumerator::InitializeCurrentEnumerator()    {        Assert(object);        ScriptContext* scriptContext = GetScriptContext();        EnumeratorFlags flags = EnumeratorFlags::EnumNonEnumerable | EnumeratorFlags::SnapShotSemantics | (enumSymbols ? EnumeratorFlags::EnumSymbols : EnumeratorFlags::None);        if (VirtualTableInfo<DynamicObject>::HasVirtualTable(object))        {            DynamicObject* dynamicObject = (DynamicObject*)object;            return dynamicObject->DynamicObject::GetEnumerator(&enumerator, flags, scriptContext);        }        return object->GetEnumerator(&enumerator, flags, scriptContext);    }
开发者ID:xiaoyinl,项目名称:ChakraCore,代码行数:13,


示例23: Assert

    BOOL ES5Array::SetPropertyWithAttributes(PropertyId propertyId, Var value, PropertyAttributes attributes, PropertyValueInfo* info, PropertyOperationFlags flags, SideEffects possibleSideEffects)    {        if (propertyId == PropertyIds::length)        {            Assert(attributes == PropertyWritable);            Assert(IsWritable(propertyId) && !IsConfigurable(propertyId) && !IsEnumerable(propertyId));            uint32 newLen = ToLengthValue(value, GetScriptContext());            GetTypeHandler()->SetLength(this, newLen, PropertyOperation_None);            return true;        }        return __super::SetPropertyWithAttributes(propertyId, value, attributes, info, flags, possibleSideEffects);    }
开发者ID:Rastaban,项目名称:ChakraCore,代码行数:14,


示例24: MapDataKeyValuePair

 void JavascriptMap::Set(Var key, Var value) {     if (map->ContainsKey(key))     {         MapDataNode* node = map->Item(key);         node->data = MapDataKeyValuePair(key, value);     }     else     {         MapDataKeyValuePair pair(key, value);         MapDataNode* node = list.Append(pair, GetScriptContext()->GetRecycler());         map->Add(key, node);     } }
开发者ID:280185386,项目名称:ChakraCore,代码行数:14,


示例25: GetScriptContext

    void ES5ArrayEnumerator::Reset()    {        initialLength = arrayObject->GetLength();        dataIndex = JavascriptArray::InvalidIndex;        descriptorIndex = JavascriptArray::InvalidIndex;        descriptor = nullptr;        descriptorValidationToken = nullptr;        index = JavascriptArray::InvalidIndex;        doneArray = false;        doneObject = false;        Var enumerator;        arrayObject->DynamicObject::GetEnumerator(enumNonEnumerable, &enumerator, GetScriptContext(), true, enumSymbols);        objectEnumerator = (JavascriptEnumerator*)enumerator;    }
开发者ID:280185386,项目名称:ChakraCore,代码行数:16,



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


C++ GetScriptId函数代码示例
C++ GetScreenWidth函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。