can-symbol
Version:
Well known symbols used to detail how to operate on different objects
20 lines (13 loc) • 561 B
Markdown
Object} can-symbol/symbols/proto can.proto
can-symbol/symbols/shape
Defines the "proto" (first element in the prototype chain) of an object
`@@can.proto`
The `@@@@can.proto` symbol is placed on an object to reference its prototype. Since the non-standard `__proto__` is deprecated, this can serve as a prototype chain reference without invoking `Object.getPrototypeOf()` every time.
```
function Foo() {}
Foo.prototype = {
bar: "baz"
};
var obj = new Foo();
obj[canSymbol.for("can.proto")] = Foo.prototype;
```
{