From a8fcb232d37a945d82845cf444203fb532b6f96f Mon Sep 17 00:00:00 2001 From: Sor4chi <80559385+sor4chi@users.noreply.github.com> Date: Thu, 31 Oct 2024 08:29:50 +0900 Subject: [PATCH] test: add staging cases --- checker/specification/staging.md | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/checker/specification/staging.md b/checker/specification/staging.md index 4739e695..bbe6ca51 100644 --- a/checker/specification/staging.md +++ b/checker/specification/staging.md @@ -1,3 +1,49 @@ Currently implementing: > This file is for work-in-progress and can help separating features that are being implemented to regressions + +### Feats + +#### `Object.freeze` + +> When `Object.freeze` is called, the object's `isSealed` is inferred as `true` + +```ts +const obj = {} +let result = Object.freeze(obj); +(obj === result) satisfies true; +obj.property = 2; +Object.isSealed(obj) satisfies true; +``` + +- Cannot write to property 'property' + +#### `Object.seal` + +> When `Object.seal` is called, the object's `isFrozen` and `isSealed` are inferred as `true` + +```ts +const obj = {} +let result = Object.seal(obj); +(obj === result) satisfies true; +obj.property = 2; +Object.isFrozen(obj) satisfies true; +Object.isSealed(obj) satisfies true; +``` + +- Cannot write to property 'property' + +#### `Object.preventExtensions` + +> When `Object.preventExtensions` is called, the object's `isFrozen` and `isSealed` are inferred as `true` + +```ts +const obj = {} +let result = Object.preventExtensions(obj); +(obj === result) satisfies true; +obj.property = 2; +Object.isFrozen(obj) satisfies true; +Object.isSealed(obj) satisfies true; +``` + +- Cannot write to property 'property'