From 4205deffbee6a6c094546913af77903a82be3494 Mon Sep 17 00:00:00 2001 From: nipher Date: Sun, 16 Apr 2017 12:45:28 -0300 Subject: [PATCH] Improve introduction doc fixing small scope issues Small issues: - Missing `var` keywords - Multiple left-hand assignments declaring global variables, more info: http://stackoverflow.com/questions/1758576/multiple-left-hand-assignment-with-javascript --- docs/manual/introduction/How-to-update-things.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/manual/introduction/How-to-update-things.html b/docs/manual/introduction/How-to-update-things.html index b937c2fd18..70bac0dad5 100644 --- a/docs/manual/introduction/How-to-update-things.html +++ b/docs/manual/introduction/How-to-update-things.html @@ -69,14 +69,14 @@ var positions = new Float32Array( MAX_POINTS * 3 ); // 3 vertices per point geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) ); // draw range -drawCount = 2; // draw the first 2 points, only +var drawCount = 2; // draw the first 2 points, only geometry.setDrawRange( 0, drawCount ); // material var material = new THREE.LineBasicMaterial( { color: 0xff0000, linewidth: 2 } ); // line -line = new THREE.Line( geometry, material ); +var line = new THREE.Line( geometry, material ); scene.add( line );

@@ -85,7 +85,8 @@ scene.add( line ); var positions = line.geometry.attributes.position.array; -var x = y = z = index = 0; +var x, y, z, index; +x = y = z = index = 0; for ( var i = 0, l = MAX_POINTS; i < l; i ++ ) { -- GitLab