Skip to content

Commit c74db80

Browse files
author
lauren mccarthy
committed
remove binding objs
1 parent 77b929d commit c74db80

File tree

3 files changed

+19
-39
lines changed

3 files changed

+19
-39
lines changed

lib/p5.js

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -247,18 +247,11 @@ var core = function (require, shim, constants) {
247247
}
248248
});
249249
if (this._isGlobal) {
250-
for (var p0 in p5.prototype) {
250+
for (var p in p5.prototype) {
251251
try {
252-
delete window[p0];
252+
delete window[p];
253253
} catch (x) {
254-
window[p0] = undefined;
255-
}
256-
}
257-
for (var p1 in p5) {
258-
try {
259-
delete window[p1];
260-
} catch (x) {
261-
window[p1] = undefined;
254+
window[p] = undefined;
262255
}
263256
}
264257
for (var p2 in this) {
@@ -278,19 +271,16 @@ var core = function (require, shim, constants) {
278271
}
279272
if (!sketch) {
280273
this._isGlobal = true;
281-
for (var p0 in p5.prototype) {
282-
if (typeof p5.prototype[p0] === 'function') {
283-
var ev = p0.substring(2);
274+
for (var p in p5.prototype) {
275+
if (typeof p5.prototype[p] === 'function') {
276+
var ev = p.substring(2);
284277
if (!this._events.hasOwnProperty(ev)) {
285-
window[p0] = p5.prototype[p0].bind(this);
278+
window[p] = p5.prototype[p].bind(this);
286279
}
287280
} else {
288-
window[p0] = p5.prototype[p0];
281+
window[p] = p5.prototype[p];
289282
}
290283
}
291-
for (var p1 in p5) {
292-
window[p1] = p5[p1];
293-
}
294284
for (var p2 in this) {
295285
if (this.hasOwnProperty(p2)) {
296286
window[p2] = this[p2];

0 commit comments

Comments
 (0)