Lines Matching refs:desc
280 var desc = GetOwnProperty(this, P);
281 return IS_UNDEFINED(desc) ? false : desc.isEnumerable();
297 var desc = new PropertyDescriptor();
298 desc.setGet(fun);
299 desc.setEnumerable(true);
300 desc.setConfigurable(true);
301 DefineOwnProperty(ToObject(receiver), ToName(name), desc, false);
323 var desc = new PropertyDescriptor();
324 desc.setSet(fun);
325 desc.setEnumerable(true);
326 desc.setConfigurable(true);
327 DefineOwnProperty(ToObject(receiver), ToName(name), desc, false);
354 function IsAccessorDescriptor(desc) {
355 if (IS_UNDEFINED(desc)) return false;
356 return desc.hasGetter() || desc.hasSetter();
361 function IsDataDescriptor(desc) {
362 if (IS_UNDEFINED(desc)) return false;
363 return desc.hasValue() || desc.hasWritable();
368 function IsGenericDescriptor(desc) {
369 if (IS_UNDEFINED(desc)) return false;
370 return !(IsAccessorDescriptor(desc) || IsDataDescriptor(desc));
374 function IsInconsistentDescriptor(desc) {
375 return IsAccessorDescriptor(desc) && IsDataDescriptor(desc);
380 function FromPropertyDescriptor(desc) {
381 if (IS_UNDEFINED(desc)) return desc;
383 if (IsDataDescriptor(desc)) {
384 return { value: desc.getValue(),
385 writable: desc.isWritable(),
386 enumerable: desc.isEnumerable(),
387 configurable: desc.isConfigurable() };
390 return { get: desc.getGet(),
391 set: desc.getSet() === ObjectSetProto ? ObjectPoisonProto
392 : desc.getSet(),
393 enumerable: desc.isEnumerable(),
394 configurable: desc.isConfigurable() };
399 function FromGenericPropertyDescriptor(desc) {
400 if (IS_UNDEFINED(desc)) return desc;
403 if (desc.hasValue()) {
404 %IgnoreAttributesAndSetProperty(obj, "value", desc.getValue(), NONE);
406 if (desc.hasWritable()) {
407 %IgnoreAttributesAndSetProperty(obj, "writable", desc.isWritable(), NONE);
409 if (desc.hasGetter()) {
410 %IgnoreAttributesAndSetProperty(obj, "get", desc.getGet(), NONE);
412 if (desc.hasSetter()) {
413 %IgnoreAttributesAndSetProperty(obj, "set", desc.getSet(), NONE);
415 if (desc.hasEnumerable()) {
417 desc.isEnumerable(), NONE);
419 if (desc.hasConfigurable()) {
421 desc.isConfigurable(), NONE);
432 var desc = new PropertyDescriptor();
435 desc.setEnumerable(ToBoolean(obj.enumerable));
439 desc.setConfigurable(ToBoolean(obj.configurable));
443 desc.setValue(obj.value);
447 desc.setWritable(ToBoolean(obj.writable));
455 desc.setGet(get);
463 desc.setSet(set);
466 if (IsInconsistentDescriptor(desc)) {
469 return desc;
475 var desc = ToPropertyDescriptor(obj);
476 if (IsGenericDescriptor(desc) || IsDataDescriptor(desc)) {
477 if (!desc.hasValue()) desc.setValue(UNDEFINED);
478 if (!desc.hasWritable()) desc.setWritable(false);
481 if (!desc.hasGetter()) desc.setGet(UNDEFINED);
482 if (!desc.hasSetter()) desc.setSet(UNDEFINED);
484 if (!desc.hasEnumerable()) desc.setEnumerable(false);
485 if (!desc.hasConfigurable()) desc.setConfigurable(false);
486 return desc;
598 var desc = new PropertyDescriptor();
601 desc.setGet(desc_array[GETTER_INDEX]);
602 desc.setSet(desc_array[SETTER_INDEX]);
604 desc.setValue(desc_array[VALUE_INDEX]);
605 desc.setWritable(desc_array[WRITABLE_INDEX]);
607 desc.setEnumerable(desc_array[ENUMERABLE_INDEX]);
608 desc.setConfigurable(desc_array[CONFIGURABLE_INDEX]);
610 return desc;
655 var desc = ToCompletePropertyDescriptor(descriptor);
656 if (!desc.isConfigurable()) {
660 return desc;
677 var desc = GetOwnProperty(obj, p);
678 if (IS_UNDEFINED(desc)) return true;
679 if (desc.isConfigurable()) {
710 function DefineObjectProperty(obj, p, desc, should_throw) {
730 if ((IsGenericDescriptor(desc) ||
731 IsDataDescriptor(desc) == IsDataDescriptor(current)) &&
732 (!desc.hasEnumerable() ||
733 SameValue(desc.isEnumerable(), current.isEnumerable())) &&
734 (!desc.hasConfigurable() ||
735 SameValue(desc.isConfigurable(), current.isConfigurable())) &&
736 (!desc.hasWritable() ||
737 SameValue(desc.isWritable(), current.isWritable())) &&
738 (!desc.hasValue() ||
739 SameValue(desc.getValue(), current.getValue())) &&
740 (!desc.hasGetter() ||
741 SameValue(desc.getGet(), current.getGet())) &&
742 (!desc.hasSetter() ||
743 SameValue(desc.getSet(), current.getSet()))) {
748 if (desc.isConfigurable() ||
749 (desc.hasEnumerable() &&
750 desc.isEnumerable() != current.isEnumerable())) {
758 if (!IsGenericDescriptor(desc)) {
760 if (IsDataDescriptor(current) != IsDataDescriptor(desc)) {
768 if (IsDataDescriptor(current) && IsDataDescriptor(desc)) {
769 if (!current.isWritable() && desc.isWritable()) {
776 if (!current.isWritable() && desc.hasValue() &&
777 !SameValue(desc.getValue(), current.getValue())) {
786 if (IsAccessorDescriptor(desc) && IsAccessorDescriptor(current)) {
787 if (desc.hasSetter() && !SameValue(desc.getSet(), current.getSet())) {
794 if (desc.hasGetter() && !SameValue(desc.getGet(),current.getGet())) {
809 // desc (we need to preserve the existing values from current).
811 if (desc.hasEnumerable()) {
812 flag |= desc.isEnumerable() ? 0 : DONT_ENUM;
819 if (desc.hasConfigurable()) {
820 flag |= desc.isConfigurable() ? 0 : DONT_DELETE;
826 if (IsDataDescriptor(desc) ||
827 (IsGenericDescriptor(desc) &&
836 if (desc.hasWritable()) {
837 flag |= desc.isWritable() ? 0 : READ_ONLY;
845 if (desc.hasValue()) {
846 value = desc.getValue();
859 var getter = desc.hasGetter() ? desc.getGet() : null;
860 var setter = desc.hasSetter() ? desc.getSet() : null;
868 function DefineArrayProperty(obj, p, desc, should_throw) {
877 if (!desc.hasValue()) {
878 return DefineObjectProperty(obj, "length", desc, should_throw);
880 var new_length = ToUint32(desc.getValue());
881 if (new_length != ToNumber(desc.getValue())) {
923 desc.value_ = UNDEFINED;
924 desc.hasValue_ = false;
925 threw = !DefineObjectProperty(obj, "length", desc, should_throw) || threw;
955 !DefineObjectProperty(obj, p, desc, true)) {
975 return DefineObjectProperty(obj, p, desc, should_throw);
980 function DefineOwnProperty(obj, p, desc, should_throw) {
985 var attributes = FromGenericPropertyDescriptor(desc);
988 return DefineArrayProperty(obj, p, desc, should_throw);
990 return DefineObjectProperty(obj, p, desc, should_throw);
1010 var desc = GetOwnProperty(obj, p);
1011 return FromPropertyDescriptor(desc);
1142 var defineObj = FromGenericPropertyDescriptor(desc);
1155 desc = descObj;
1158 var desc = ToPropertyDescriptor(attributes);
1159 DefineOwnProperty(obj, name, desc, true);
1234 var desc = GetOwnProperty(obj, name);
1235 if (desc.isConfigurable()) {
1236 desc.setConfigurable(false);
1237 DefineOwnProperty(obj, name, desc, true);
1258 var desc = GetOwnProperty(obj, name);
1259 if (desc.isWritable() || desc.isConfigurable()) {
1260 if (IsDataDescriptor(desc)) desc.setWritable(false);
1261 desc.setConfigurable(false);
1262 DefineOwnProperty(obj, name, desc, true);
1302 var desc = GetOwnProperty(obj, name);
1303 if (desc.isConfigurable()) return false;
1323 var desc = GetOwnProperty(obj, name);
1324 if (IsDataDescriptor(desc) && desc.isWritable()) return false;
1325 if (desc.isConfigurable()) return false;