本文整理汇总了C++中Arguments::createStrictModeCalleeIfNecessary方法的典型用法代码示例。如果您正苦于以下问题:C++ Arguments::createStrictModeCalleeIfNecessary方法的具体用法?C++ Arguments::createStrictModeCalleeIfNecessary怎么用?C++ Arguments::createStrictModeCalleeIfNecessary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Arguments
的用法示例。
在下文中一共展示了Arguments::createStrictModeCalleeIfNecessary方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deleteProperty
bool Arguments::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName)
{
if (exec->vm().isInDefineOwnProperty())
return Base::deleteProperty(cell, exec, propertyName);
Arguments* thisObject = jsCast<Arguments*>(cell);
unsigned i = propertyName.asIndex();
if (i < thisObject->m_numArguments) {
RELEASE_ASSERT(i < PropertyName::NotAnIndex);
if (!Base::deleteProperty(cell, exec, propertyName))
return false;
if (thisObject->tryDeleteArgument(exec->vm(), i))
return true;
}
if (propertyName == exec->propertyNames().length && !thisObject->m_overrodeLength) {
thisObject->m_overrodeLength = true;
return true;
}
if (propertyName == exec->propertyNames().callee && !thisObject->m_overrodeCallee) {
if (!thisObject->m_isStrictMode) {
thisObject->m_overrodeCallee = true;
return true;
}
thisObject->createStrictModeCalleeIfNecessary(exec);
}
if (propertyName == exec->propertyNames().caller && thisObject->m_isStrictMode)
thisObject->createStrictModeCallerIfNecessary(exec);
return JSObject::deleteProperty(thisObject, exec, propertyName);
}
示例2: put
void Arguments::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
Arguments* thisObject = static_cast<Arguments*>(cell);
bool isArrayIndex;
unsigned i = propertyName.toArrayIndex(isArrayIndex);
if (isArrayIndex && i < thisObject->d->numArguments && (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])) {
if (i < thisObject->d->numParameters)
thisObject->d->registers[thisObject->d->firstParameterIndex + i].set(exec->globalData(), thisObject->d->activation ? static_cast<JSCell*>(thisObject->d->activation.get()) : static_cast<JSCell*>(thisObject), value);
else
thisObject->d->extraArguments[i - thisObject->d->numParameters].set(exec->globalData(), thisObject, value);
return;
}
if (propertyName == exec->propertyNames().length && !thisObject->d->overrodeLength) {
thisObject->d->overrodeLength = true;
thisObject->putDirect(exec->globalData(), propertyName, value, DontEnum);
return;
}
if (propertyName == exec->propertyNames().callee && !thisObject->d->overrodeCallee) {
if (!thisObject->d->isStrictMode) {
thisObject->d->overrodeCallee = true;
thisObject->putDirect(exec->globalData(), propertyName, value, DontEnum);
return;
}
thisObject->createStrictModeCalleeIfNecessary(exec);
}
if (propertyName == exec->propertyNames().caller && thisObject->d->isStrictMode)
thisObject->createStrictModeCallerIfNecessary(exec);
JSObject::put(thisObject, exec, propertyName, value, slot);
}
示例3: put
void Arguments::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
{
Arguments* thisObject = jsCast<Arguments*>(cell);
unsigned i = propertyName.asIndex();
if (thisObject->trySetArgument(exec->vm(), i, value))
return;
if (propertyName == exec->propertyNames().length && !thisObject->m_overrodeLength) {
thisObject->m_overrodeLength = true;
thisObject->putDirect(exec->vm(), propertyName, value, DontEnum);
return;
}
if (propertyName == exec->propertyNames().callee && !thisObject->m_overrodeCallee) {
if (!thisObject->m_isStrictMode) {
thisObject->m_overrodeCallee = true;
thisObject->putDirect(exec->vm(), propertyName, value, DontEnum);
return;
}
thisObject->createStrictModeCalleeIfNecessary(exec);
}
if (propertyName == exec->propertyNames().caller && thisObject->m_isStrictMode)
thisObject->createStrictModeCallerIfNecessary(exec);
JSObject::put(thisObject, exec, propertyName, value, slot);
}
示例4: deleteProperty
bool Arguments::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
{
Arguments* thisObject = static_cast<Arguments*>(cell);
bool isArrayIndex;
unsigned i = propertyName.toArrayIndex(isArrayIndex);
if (isArrayIndex && i < thisObject->d->numArguments) {
if (!thisObject->d->deletedArguments) {
thisObject->d->deletedArguments = adoptArrayPtr(new bool[thisObject->d->numArguments]);
memset(thisObject->d->deletedArguments.get(), 0, sizeof(bool) * thisObject->d->numArguments);
}
if (!thisObject->d->deletedArguments[i]) {
thisObject->d->deletedArguments[i] = true;
return true;
}
}
if (propertyName == exec->propertyNames().length && !thisObject->d->overrodeLength) {
thisObject->d->overrodeLength = true;
return true;
}
if (propertyName == exec->propertyNames().callee && !thisObject->d->overrodeCallee) {
if (!thisObject->d->isStrictMode) {
thisObject->d->overrodeCallee = true;
return true;
}
thisObject->createStrictModeCalleeIfNecessary(exec);
}
if (propertyName == exec->propertyNames().caller && !thisObject->d->isStrictMode)
thisObject->createStrictModeCallerIfNecessary(exec);
return JSObject::deleteProperty(thisObject, exec, propertyName);
}
示例5: getOwnPropertySlot
bool Arguments::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
Arguments* thisObject = static_cast<Arguments*>(cell);
bool isArrayIndex;
unsigned i = propertyName.toArrayIndex(isArrayIndex);
if (isArrayIndex && i < thisObject->d->numArguments && (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])) {
if (i < thisObject->d->numParameters) {
slot.setValue(thisObject->d->registers[thisObject->d->firstParameterIndex + i].get());
} else
slot.setValue(thisObject->d->extraArguments[i - thisObject->d->numParameters].get());
return true;
}
if (propertyName == exec->propertyNames().length && LIKELY(!thisObject->d->overrodeLength)) {
slot.setValue(jsNumber(thisObject->d->numArguments));
return true;
}
if (propertyName == exec->propertyNames().callee && LIKELY(!thisObject->d->overrodeCallee)) {
if (!thisObject->d->isStrictMode) {
slot.setValue(thisObject->d->callee.get());
return true;
}
thisObject->createStrictModeCalleeIfNecessary(exec);
}
if (propertyName == exec->propertyNames().caller && thisObject->d->isStrictMode)
thisObject->createStrictModeCallerIfNecessary(exec);
return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot);
}
示例6: put
void Arguments::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
{
Arguments* thisObject = jsCast<Arguments*>(cell);
unsigned i = propertyName.asIndex();
if (i < thisObject->d->numArguments && (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])) {
ASSERT(i < PropertyName::NotAnIndex);
thisObject->argument(i).set(exec->globalData(), thisObject, value);
return;
}
if (propertyName == exec->propertyNames().length && !thisObject->d->overrodeLength) {
thisObject->d->overrodeLength = true;
thisObject->putDirect(exec->globalData(), propertyName, value, DontEnum);
return;
}
if (propertyName == exec->propertyNames().callee && !thisObject->d->overrodeCallee) {
if (!thisObject->d->isStrictMode) {
thisObject->d->overrodeCallee = true;
thisObject->putDirect(exec->globalData(), propertyName, value, DontEnum);
return;
}
thisObject->createStrictModeCalleeIfNecessary(exec);
}
if (propertyName == exec->propertyNames().caller && thisObject->d->isStrictMode)
thisObject->createStrictModeCallerIfNecessary(exec);
JSObject::put(thisObject, exec, propertyName, value, slot);
}
示例7: getOwnPropertyDescriptor
bool Arguments::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
{
Arguments* thisObject = jsCast<Arguments*>(object);
unsigned i = propertyName.asIndex();
if (i < thisObject->d->numArguments && (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])) {
ASSERT(i < PropertyName::NotAnIndex);
descriptor.setDescriptor(thisObject->argument(i).get(), None);
return true;
}
if (propertyName == exec->propertyNames().length && LIKELY(!thisObject->d->overrodeLength)) {
descriptor.setDescriptor(jsNumber(thisObject->d->numArguments), DontEnum);
return true;
}
if (propertyName == exec->propertyNames().callee && LIKELY(!thisObject->d->overrodeCallee)) {
if (!thisObject->d->isStrictMode) {
descriptor.setDescriptor(thisObject->d->callee.get(), DontEnum);
return true;
}
thisObject->createStrictModeCalleeIfNecessary(exec);
}
if (propertyName == exec->propertyNames().caller && thisObject->d->isStrictMode)
thisObject->createStrictModeCallerIfNecessary(exec);
return JSObject::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
}
示例8: getOwnPropertySlot
bool Arguments::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
Arguments* thisObject = jsCast<Arguments*>(cell);
unsigned i = propertyName.asIndex();
if (i < thisObject->d->numArguments && (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])) {
ASSERT(i < PropertyName::NotAnIndex);
slot.setValue(thisObject->argument(i).get());
return true;
}
if (propertyName == exec->propertyNames().length && LIKELY(!thisObject->d->overrodeLength)) {
slot.setValue(jsNumber(thisObject->d->numArguments));
return true;
}
if (propertyName == exec->propertyNames().callee && LIKELY(!thisObject->d->overrodeCallee)) {
if (!thisObject->d->isStrictMode) {
slot.setValue(thisObject->d->callee.get());
return true;
}
thisObject->createStrictModeCalleeIfNecessary(exec);
}
if (propertyName == exec->propertyNames().caller && thisObject->d->isStrictMode)
thisObject->createStrictModeCallerIfNecessary(exec);
return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot);
}
示例9: deleteProperty
bool Arguments::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName)
{
if (exec->globalData().isInDefineOwnProperty())
return Base::deleteProperty(cell, exec, propertyName);
Arguments* thisObject = jsCast<Arguments*>(cell);
unsigned i = propertyName.asIndex();
if (i < thisObject->d->numArguments) {
ASSERT(i < PropertyName::NotAnIndex);
if (!Base::deleteProperty(cell, exec, propertyName))
return false;
if (!thisObject->d->deletedArguments) {
thisObject->d->deletedArguments = adoptArrayPtr(new bool[thisObject->d->numArguments]);
memset(thisObject->d->deletedArguments.get(), 0, sizeof(bool) * thisObject->d->numArguments);
}
if (!thisObject->d->deletedArguments[i]) {
thisObject->d->deletedArguments[i] = true;
return true;
}
}
if (propertyName == exec->propertyNames().length && !thisObject->d->overrodeLength) {
thisObject->d->overrodeLength = true;
return true;
}
if (propertyName == exec->propertyNames().callee && !thisObject->d->overrodeCallee) {
if (!thisObject->d->isStrictMode) {
thisObject->d->overrodeCallee = true;
return true;
}
thisObject->createStrictModeCalleeIfNecessary(exec);
}
if (propertyName == exec->propertyNames().caller && thisObject->d->isStrictMode)
thisObject->createStrictModeCallerIfNecessary(exec);
return JSObject::deleteProperty(thisObject, exec, propertyName);
}
示例10: getOwnPropertySlot
bool Arguments::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
Arguments* thisObject = jsCast<Arguments*>(object);
unsigned i = propertyName.asIndex();
if (JSValue value = thisObject->tryGetArgument(i)) {
RELEASE_ASSERT(i < PropertyName::NotAnIndex);
slot.setValue(thisObject, None, value);
return true;
}
if (propertyName == exec->propertyNames().length && LIKELY(!thisObject->m_overrodeLength)) {
slot.setValue(thisObject, DontEnum, jsNumber(thisObject->m_numArguments));
return true;
}
if (propertyName == exec->propertyNames().callee && LIKELY(!thisObject->m_overrodeCallee)) {
if (!thisObject->m_isStrictMode) {
slot.setValue(thisObject, DontEnum, thisObject->m_callee.get());
return true;
}
thisObject->createStrictModeCalleeIfNecessary(exec);
}
if (propertyName == exec->propertyNames().caller && thisObject->m_isStrictMode)
thisObject->createStrictModeCallerIfNecessary(exec);
if (JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot))
return true;
if (propertyName == exec->propertyNames().iteratorPrivateName) {
VM& vm = exec->vm();
JSGlobalObject* globalObject = exec->lexicalGlobalObject();
thisObject->JSC_NATIVE_FUNCTION(exec->propertyNames().iteratorPrivateName, argumentsFuncIterator, DontEnum, 0);
if (JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot))
return true;
}
return false;
}