本文整理汇总了C++中StringObject::isExtensible方法的典型用法代码示例。如果您正苦于以下问题:C++ StringObject::isExtensible方法的具体用法?C++ StringObject::isExtensible怎么用?C++ StringObject::isExtensible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringObject
的用法示例。
在下文中一共展示了StringObject::isExtensible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: defineOwnProperty
bool StringObject::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName propertyName, const PropertyDescriptor& descriptor, bool throwException)
{
VM& vm = exec->vm();
auto scope = DECLARE_THROW_SCOPE(vm);
StringObject* thisObject = jsCast<StringObject*>(object);
if (isStringOwnProperty(exec, thisObject, propertyName)) {
// The current PropertyDescriptor is always
// PropertyDescriptor{[[Value]]: value, [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: false}.
// This ensures that any property descriptor cannot change the existing one.
// Here, simply return the result of validateAndApplyPropertyDescriptor.
// https://tc39.github.io/ecma262/#sec-string-exotic-objects-getownproperty-p
PropertyDescriptor current;
bool isCurrentDefined = thisObject->getOwnPropertyDescriptor(exec, propertyName, current);
ASSERT(isCurrentDefined);
bool isExtensible = thisObject->isExtensible(exec);
RETURN_IF_EXCEPTION(scope, false);
return validateAndApplyPropertyDescriptor(exec, nullptr, propertyName, isExtensible, descriptor, isCurrentDefined, current, throwException);
}
return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException);
}