canjs / can-component

Custom elements and widgets
https://canjs.com/doc/can-component.html
MIT License
8 stars 8 forks source link

Component instantiation with viewModel prop to null dosent work #293

Closed cherifGsoul closed 6 years ago

cherifGsoul commented 6 years ago

I have this component:

var ComponentCtor = Component.extend({
   tag: 'a-tag',
   ViewModel: {
       foo: {
         default() {
            return "bar";
         }
      }
    }
});

when the component is instantiated like this:

var componentInst = new ComponentCtor({
   viewModel: {
        foo: null
    }
});

It throws an error Uncaught TypeError: Cannot read property 'Symbol(can.getValue)' of null