Open ashleyw opened 5 years ago
@ashleyw Object.create will set this.active as a prototype of a newly created object context. When a property is not found directly on context it will be searched on its prototype, in this case, this.active.
const prot = { test: 5 };
const obj = Object.create(prot);
console.log(obj.test)
// 5
Hi,
From what I understand, nested contexts are permitted and values will be inherited, however within
createContext
it currently usesObject.create()
, but that doesn't actually clone the active context (on Node v8.16.0 & v10.16.0):Where I believe it should be using
Object.assign()
to clone the object:For example:
Whereas:
Am I missing something, or is this a bug?
Thanks!