diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a94b0c..3a2af64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,17 @@ +# 1.0.11 + +## Fix + +- Source map restoration +- prototype line consistence + # 1.0.10 ## Change - linter from prettier+eslint to biome -## Bug-fix +## Fix - `KeySet` now rooted on `Object.create(null)` instead of `{}` so that `'constructor' in secludedProperties` is false - Temporary object (modified as head with `this` diamond as proxy) now has good constructor and `instanceof` diff --git a/src/seclude.ts b/src/seclude.ts index ef37c3a..92c0190 100644 --- a/src/seclude.ts +++ b/src/seclude.ts @@ -59,6 +59,7 @@ export function Seclude() diff --git a/test/prototypes.test.ts b/test/prototypes.test.ts new file mode 100644 index 0000000..509db33 --- /dev/null +++ b/test/prototypes.test.ts @@ -0,0 +1,35 @@ +import Diamond from '../src' + +class X {} + +class A extends Diamond(X) {} + +class B extends A {} +class C extends A {} + +class D extends Diamond(B, C) {} + +test('prototype console', () => { + const d = new D() + + for ( + let browser = Object.getPrototypeOf(d); + browser !== Object.prototype; + browser = Object.getPrototypeOf(browser) + ) { + console.log(browser.constructor.name) + } +}) +test('prototype line', () => { + const expected = ['D', 'Diamond', 'B', 'A', 'C', 'A', 'X', 'Object'] + const d = new D() + + for ( + let browser = Object.getPrototypeOf(d); + browser !== Object.prototype; + browser = Object.getPrototypeOf(browser) + ) { + expect(browser.constructor.name).toBe(expected.shift()) + } + expect(expected).toEqual(['Object']) +}) diff --git a/tsconfig.json b/tsconfig.json index e487b94..81783df 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,10 @@ "moduleResolution": "Node", "target": "ESNext", "module": "ESNext", + "sourceMap": true, "declaration": false, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, "strict": true, "esModuleInterop": true, "skipLibCheck": false,