Skip to content

Component instances should implement getOwnKeys #326

@phillipskevin

Description

@phillipskevin

Right now if you create a component and call canReflect.getOwnKeys, you get a bunch of keys back:

import { Component, Reflect } from "//unpkg.com/can@5/core.mjs";

const C = Component.extend({
  tag: "a-pp",
  view: `
    Hello CanJS
  `,
  ViewModel: {}
});

const c = new C();

Reflect.getOwnKeys(c); // ["__inSetup", "_initialArgs", "element", "viewModel", "nodeList", "_torndown"]

... these aren't really useful.

Also, this causes CanJS Devtools to throw an exception because it tries to do something basically like this:

const v = new DefineMap({});
Reflect.updateDeep(v, { __inSetup: false });

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions