Lazy evaluation

peter miller fuchsia.groan at virgin.net
Mon Sep 11 10:54:16 UTC 2017


Hi Andrea,

> ```
> class CaseLazy {
>   get bar() {
>     var value = Math.random();
>     Object.defineProperty(this, 'bar', {value});
>     return value;
>   }
> }
> ```

Doesn't this count as redefining the shape of the object? Or are the  
compilers fine with it?

Peter
-- 
"There were drawings, and sheets of paper with writing on them, and it  
seemed that they were the sustenance of life, that here were the warlocks,  
almost the vehicles of destruction of man's life, but at the same time the  
very reason for his living." --- Maeve Gilmore/Titus Awakes.


More information about the es-discuss mailing list