We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__proto__
Object.getPrototypeOf
When I use zag ui with deno, some components doesn't work because deno doesn't implement __proto__.
Object.getPrototypeOf also has good compatibility, so I think replacing __proto__ is ok.
chakra-ui/zag#1717
The text was updated successfully, but these errors were encountered:
To not waste too many words...
import { klona as klonaLite } from 'klona/lite'; const obj = Object.create(null, Object.getOwnPropertyDescriptors({ key1: 'val1', key2: 'val2' })); assert.deepStrictEqual(klonaLite(obj), obj); /* AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal: + actual - expected + { - [Object: null prototype] { key1: 'val1', key2: 'val2' } generatedMessage: true, code: 'ERR_ASSERTION', actual: { key1: 'val1', key2: 'val2' }, expected: [Object: null prototype] { key1: 'val1', key2: 'val2' }, operator: 'deepStrictEqual' }*/
import { klona as klonaLite } from 'klona/lite'; const obj = { key1: 'val1', key2: 'val2', __proto__: { key3: 'val3-parent', key4: 'val4-parent', } }; assert.deepStrictEqual(klonaLite(obj), obj); /* AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal: + actual - expected { key1: 'val1', key2: 'val2', + key3: 'val3-parent', + key4: 'val4-parent' } generatedMessage: true, code: 'ERR_ASSERTION', actual: { key1: 'val1', key2: 'val2', key3: 'val3-parent', key4: 'val4-parent' }, expected: { key1: 'val1', key2: 'val2' }, operator: 'deepStrictEqual' }*/
Object.prototype.__proto__ is an accessor property with attribute Enumerable: false
Object.prototype.__proto__
Enumerable: false
The for...in statement iterates over all enumerable string properties of an object including inherited enumerable properties.
for...in
patch for lite/basic:
... var k, proto, tmp, str=Object.prototype.toString.call(x); if (str === '[object Object]') { if (x.constructor === undefined) { tmp = Object.create(null); for (k in x) tmp[k] = klona(x[k]); } else { proto = x.__proto__ || Object.getPrototypeOf(x); tmp = (proto !== Object.prototype) ? Object.create(proto) : {}; for (k in x) if (Object.prototype.hasOwnProperty.call(x, k) === true) tmp[k] = klona(x[k]); } return tmp; } ...
Now implement this to full version..
Sorry, something went wrong.
No branches or pull requests
When I use zag ui with deno, some components doesn't work because deno doesn't implement
__proto__
.Object.getPrototypeOf
also has good compatibility, so I think replacing__proto__
is ok.chakra-ui/zag#1717
The text was updated successfully, but these errors were encountered: