add verifyPrimordialProperty

This commit is contained in:
Peter Hoddie 2024-09-21 17:51:42 -07:00 committed by Philip Chimento
parent f923513ec6
commit d6155b6ef2
3 changed files with 18 additions and 0 deletions

View File

@ -13,6 +13,7 @@ defines:
- verifyNotEnumerable # deprecated - verifyNotEnumerable # deprecated
- verifyConfigurable # deprecated - verifyConfigurable # deprecated
- verifyNotConfigurable # deprecated - verifyNotConfigurable # deprecated
- verifyPrimordialProperty
---*/ ---*/
// @ts-check // @ts-check
@ -280,3 +281,10 @@ function verifyNotConfigurable(obj, name) {
throw new Test262Error("Expected obj[" + String(name) + "] NOT to be configurable, but was."); throw new Test262Error("Expected obj[" + String(name) + "] NOT to be configurable, but was.");
} }
} }
/**
* Use this function to verify the properties of a primordial object.
* For non-primordial objects, use verifyProperty.
* See: https://github.com/tc39/how-we-work/blob/main/terminology.md#primordial
*/
var verifyPrimordialProperty = verifyProperty;

View File

@ -9,5 +9,7 @@ class CheckHarness(Check):
def run(self, name, meta, source): def run(self, name, meta, source):
if 'verifyConfigurable(' in source and 'verifyProperty(' in source: if 'verifyConfigurable(' in source and 'verifyProperty(' in source:
return 'verifyConfigurable & verifyProperty may not be used in the same file' return 'verifyConfigurable & verifyProperty may not be used in the same file'
elif 'verifyConfigurable(' in source and 'verifyPrimordialProperty(' in source:
return 'verifyConfigurable & verifyPrimordialProperty may not be used in the same file'
else: else:
return return

View File

@ -13,6 +13,7 @@ defines:
- verifyNotEnumerable - verifyNotEnumerable
- verifyConfigurable - verifyConfigurable
- verifyNotConfigurable - verifyNotConfigurable
- verifyPrimordialProperty
---*/ ---*/
// @ts-check // @ts-check
@ -227,3 +228,10 @@ function verifyNotConfigurable(obj, name) {
throw new Test262Error("Expected obj[" + String(name) + "] NOT to be configurable, but was."); throw new Test262Error("Expected obj[" + String(name) + "] NOT to be configurable, but was.");
} }
} }
/**
* Use this function to verify the properties of a primordial object.
* For non-primordial objects, use verifyProperty.
* See: https://github.com/tc39/how-we-work/blob/main/terminology.md#primordial
*/
var verifyPrimordialProperty = verifyProperty;