MCPcopy Create free account
hub / github.com/fbeline/design-patterns-JS / CarProxy

Class CarProxy

src/structural/proxy/proxy_es6.js:7–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5}
6
7class CarProxy {
8 constructor(driver) {
9 this.driver = driver;
10 }
11 drive() {
12 return (this.driver.age < 18) ? "too young to drive" : new Car().drive();
13 };
14}
15
16class Driver {
17 constructor(age) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected