MCPcopy Create free account
hub / github.com/VitoHowe/glm-coding / getContext

Function getContext

app/services/tdc_vm_runner.cjs:102–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100 if (normalized === 'canvas') {
101 return createElementStub({
102 getContext() {
103 return makeNoopProxy({
104 fillRect() {},
105 clearRect() {},
106 getImageData() {
107 return { data: new Uint8ClampedArray(4) };
108 },
109 putImageData() {},
110 createImageData() {
111 return [];
112 },
113 setTransform() {},
114 drawImage() {},
115 save() {},
116 fillText() {},
117 restore() {},
118 beginPath() {},
119 moveTo() {},
120 lineTo() {},
121 closePath() {},
122 stroke() {},
123 translate() {},
124 scale() {},
125 rotate() {},
126 arc() {},
127 fill() {},
128 measureText(text) {
129 return { width: String(text).length * 8 };
130 },
131 transform() {},
132 rect() {},
133 clip() {},
134 });
135 },
136 toDataURL() {
137 return 'data:image/png;base64,AAAA';
138 },

Callers

nothing calls this directly

Calls 1

makeNoopProxyFunction · 0.85

Tested by

no test coverage detected