super-three 0.177.0 → 0.179.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/three.cjs +959 -231
- package/build/three.core.js +751 -170
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +210 -64
- package/build/three.module.min.js +1 -1
- package/build/three.tsl.js +78 -29
- package/build/three.tsl.min.js +1 -1
- package/build/three.webgpu.js +3269 -1545
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +3093 -1545
- package/build/three.webgpu.nodes.min.js +1 -1
- package/examples/jsm/Addons.js +1 -2
- package/examples/jsm/capabilities/WebGL.js +0 -27
- package/examples/jsm/capabilities/WebGPU.js +1 -1
- package/examples/jsm/controls/ArcballControls.js +1 -1
- package/examples/jsm/controls/TransformControls.js +61 -14
- package/examples/jsm/csm/CSMShadowNode.js +4 -4
- package/examples/jsm/environments/RoomEnvironment.js +8 -3
- package/examples/jsm/exporters/USDZExporter.js +676 -299
- package/examples/jsm/geometries/RoundedBoxGeometry.js +47 -8
- package/examples/jsm/interactive/HTMLMesh.js +5 -3
- package/examples/jsm/libs/meshopt_decoder.module.js +75 -58
- package/examples/jsm/lights/LightProbeGenerator.js +14 -3
- package/examples/jsm/loaders/ColladaLoader.js +1 -1
- package/examples/jsm/loaders/EXRLoader.js +210 -22
- package/examples/jsm/loaders/FBXLoader.js +2 -2
- package/examples/jsm/loaders/MaterialXLoader.js +212 -30
- package/examples/jsm/loaders/TTFLoader.js +13 -1
- package/examples/jsm/loaders/USDLoader.js +219 -0
- package/examples/jsm/loaders/USDZLoader.js +4 -892
- package/examples/jsm/loaders/usd/USDAParser.js +741 -0
- package/examples/jsm/loaders/usd/USDCParser.js +17 -0
- package/examples/jsm/objects/LensflareMesh.js +3 -3
- package/examples/jsm/objects/SkyMesh.js +2 -2
- package/examples/jsm/physics/RapierPhysics.js +95 -16
- package/examples/jsm/postprocessing/GTAOPass.js +10 -9
- package/examples/jsm/postprocessing/OutlinePass.js +17 -17
- package/examples/jsm/postprocessing/SSAOPass.js +10 -9
- package/examples/jsm/shaders/UnpackDepthRGBAShader.js +11 -2
- package/examples/jsm/transpiler/AST.js +381 -30
- package/examples/jsm/transpiler/GLSLDecoder.js +226 -86
- package/examples/jsm/transpiler/Linker.js +327 -0
- package/examples/jsm/transpiler/TSLEncoder.js +197 -92
- package/examples/jsm/transpiler/Transpiler.js +17 -1
- package/examples/jsm/transpiler/TranspilerUtils.js +29 -0
- package/examples/jsm/transpiler/WGSLEncoder.js +788 -0
- package/examples/jsm/tsl/display/BloomNode.js +8 -7
- package/examples/jsm/tsl/display/ChromaticAberrationNode.js +206 -0
- package/examples/jsm/tsl/display/GaussianBlurNode.js +8 -10
- package/examples/jsm/tsl/display/SSAAPassNode.js +2 -2
- package/examples/jsm/tsl/display/{TRAAPassNode.js → TRAANode.js} +181 -172
- package/examples/jsm/tsl/display/hashBlur.js +3 -3
- package/examples/jsm/tsl/lighting/TiledLightsNode.js +1 -1
- package/package.json +1 -1
- package/src/Three.Core.js +1 -0
- package/src/Three.TSL.js +77 -28
- package/src/Three.WebGPU.js +2 -0
- package/src/animation/KeyframeTrack.js +1 -1
- package/src/animation/tracks/BooleanKeyframeTrack.js +1 -1
- package/src/animation/tracks/StringKeyframeTrack.js +1 -1
- package/src/cameras/Camera.js +14 -0
- package/src/cameras/OrthographicCamera.js +1 -1
- package/src/cameras/PerspectiveCamera.js +1 -1
- package/src/constants.js +3 -3
- package/src/core/BufferAttribute.js +3 -3
- package/src/core/Clock.js +2 -8
- package/src/core/GLBufferAttribute.js +13 -1
- package/src/core/Object3D.js +1 -1
- package/{examples/jsm/misc → src/core}/Timer.js +4 -42
- package/src/extras/PMREMGenerator.js +11 -0
- package/src/extras/core/Path.js +22 -22
- package/src/helpers/CameraHelper.js +41 -11
- package/src/helpers/SkeletonHelper.js +35 -6
- package/src/lights/LightShadow.js +21 -8
- package/src/lights/PointLightShadow.js +1 -1
- package/src/loaders/FileLoader.js +27 -4
- package/src/loaders/ImageBitmapLoader.js +27 -4
- package/src/loaders/ImageLoader.js +55 -8
- package/src/loaders/Loader.js +14 -0
- package/src/loaders/LoadingManager.js +23 -0
- package/src/materials/MeshBasicMaterial.js +1 -1
- package/src/materials/nodes/Line2NodeMaterial.js +0 -8
- package/src/materials/nodes/MeshBasicNodeMaterial.js +4 -3
- package/src/materials/nodes/MeshMatcapNodeMaterial.js +1 -1
- package/src/materials/nodes/MeshNormalNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +2 -1
- package/src/materials/nodes/MeshSSSNodeMaterial.js +2 -2
- package/src/materials/nodes/NodeMaterial.js +28 -5
- package/src/materials/nodes/PointsNodeMaterial.js +5 -0
- package/src/materials/nodes/manager/NodeMaterialObserver.js +87 -2
- package/src/math/Frustum.js +25 -9
- package/src/math/FrustumArray.js +10 -5
- package/src/math/Line3.js +129 -2
- package/src/math/Matrix4.js +48 -27
- package/src/math/Quaternion.js +1 -1
- package/src/math/Spherical.js +2 -2
- package/src/nodes/Nodes.js +2 -3
- package/src/nodes/TSL.js +5 -3
- package/src/nodes/accessors/AccessorsUtils.js +7 -8
- package/src/nodes/accessors/Bitangent.js +31 -25
- package/src/nodes/accessors/Camera.js +12 -12
- package/src/nodes/accessors/Normal.js +95 -29
- package/src/nodes/accessors/Object3DNode.js +1 -1
- package/src/nodes/accessors/Position.js +7 -7
- package/src/nodes/accessors/ReferenceNode.js +18 -3
- package/src/nodes/accessors/ReflectVector.js +3 -3
- package/src/nodes/accessors/SceneNode.js +1 -1
- package/src/nodes/accessors/StorageTextureNode.js +1 -1
- package/src/nodes/accessors/Tangent.js +25 -17
- package/src/nodes/accessors/TangentUtils.js +46 -0
- package/src/nodes/accessors/TextureBicubic.js +21 -3
- package/src/nodes/accessors/TextureNode.js +12 -0
- package/src/nodes/accessors/UniformArrayNode.js +0 -16
- package/src/nodes/core/ArrayNode.js +12 -0
- package/src/nodes/core/AssignNode.js +3 -0
- package/src/nodes/core/CacheNode.js +0 -14
- package/src/nodes/core/ContextNode.js +20 -1
- package/src/nodes/core/Node.js +15 -3
- package/src/nodes/core/NodeBuilder.js +228 -92
- package/src/nodes/core/NodeUtils.js +4 -1
- package/src/nodes/core/StackNode.js +49 -29
- package/src/nodes/core/SubBuildNode.js +89 -0
- package/src/nodes/core/UniformNode.js +63 -5
- package/src/nodes/core/VarNode.js +91 -2
- package/src/nodes/core/VaryingNode.js +6 -4
- package/src/nodes/display/BlendModes.js +2 -2
- package/src/nodes/display/FrontFacingNode.js +34 -2
- package/src/nodes/display/NormalMapNode.js +19 -50
- package/src/nodes/display/PassNode.js +157 -9
- package/src/nodes/display/ScreenNode.js +0 -26
- package/src/nodes/display/ViewportTextureNode.js +67 -7
- package/src/nodes/functions/BSDF/BRDF_GGX.js +2 -6
- package/src/nodes/functions/BSDF/BRDF_Sheen.js +4 -4
- package/src/nodes/functions/PhongLightingModel.js +3 -3
- package/src/nodes/functions/PhysicalLightingModel.js +16 -16
- package/src/nodes/functions/material/getGeometryRoughness.js +2 -2
- package/src/nodes/gpgpu/AtomicFunctionNode.js +1 -1
- package/src/nodes/gpgpu/ComputeNode.js +67 -23
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +28 -3
- package/src/nodes/lighting/EnvironmentNode.js +5 -5
- package/src/nodes/lighting/LightsNode.js +4 -4
- package/src/nodes/lighting/ProjectorLightNode.js +19 -6
- package/src/nodes/lighting/ShadowFilterNode.js +1 -1
- package/src/nodes/lighting/ShadowNode.js +2 -2
- package/src/nodes/materialx/MaterialXNodes.js +131 -2
- package/src/nodes/materialx/lib/mx_noise.js +165 -1
- package/src/nodes/math/ConditionalNode.js +1 -20
- package/src/nodes/math/MathNode.js +90 -55
- package/src/nodes/math/OperatorNode.js +22 -39
- package/src/nodes/tsl/TSLBase.js +1 -0
- package/src/nodes/tsl/TSLCore.js +114 -55
- package/src/nodes/utils/DebugNode.js +1 -1
- package/src/nodes/utils/EquirectUV.js +27 -0
- package/src/nodes/utils/EventNode.js +83 -0
- package/src/nodes/utils/LoopNode.js +0 -17
- package/src/nodes/utils/MatcapUV.js +22 -0
- package/src/nodes/utils/RTTNode.js +22 -5
- package/src/nodes/utils/ReflectorNode.js +11 -4
- package/src/nodes/utils/SampleNode.js +81 -0
- package/src/nodes/utils/TriplanarTextures.js +65 -0
- package/src/objects/BatchedMesh.js +4 -2
- package/src/renderers/WebGLRenderer.js +26 -24
- package/src/renderers/common/Background.js +2 -2
- package/src/renderers/common/Bindings.js +19 -18
- package/src/renderers/common/Color4.js +2 -2
- package/src/renderers/common/CubeRenderTarget.js +1 -1
- package/src/renderers/common/PostProcessing.js +60 -5
- package/src/renderers/common/RenderObject.js +68 -3
- package/src/renderers/common/Renderer.js +19 -16
- package/src/renderers/common/SampledTexture.js +3 -71
- package/src/renderers/common/Sampler.js +79 -0
- package/src/renderers/common/Storage3DTexture.js +100 -0
- package/src/renderers/common/StorageArrayTexture.js +84 -0
- package/src/renderers/common/StorageTexture.js +19 -0
- package/src/renderers/common/Textures.js +19 -3
- package/src/renderers/common/XRManager.js +31 -12
- package/src/renderers/common/XRRenderTarget.js +21 -4
- package/src/renderers/common/extras/PMREMGenerator.js +1 -1
- package/src/renderers/common/nodes/NodeSampledTexture.js +0 -12
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +20 -2
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +11 -2
- package/src/renderers/webgl/WebGLAttributes.js +4 -0
- package/src/renderers/webgl/WebGLCapabilities.js +2 -2
- package/src/renderers/webgl/WebGLProgram.js +12 -6
- package/src/renderers/webgl/WebGLPrograms.js +6 -4
- package/src/renderers/webgl/WebGLShadowMap.js +11 -1
- package/src/renderers/webgl/WebGLState.js +4 -4
- package/src/renderers/webgl/WebGLTextures.js +19 -7
- package/src/renderers/webgl-fallback/WebGLBackend.js +103 -72
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +3 -5
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +4 -0
- package/src/renderers/webgl-fallback/utils/WebGLState.js +4 -4
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +2 -0
- package/src/renderers/webgpu/WebGPUBackend.js +63 -16
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +64 -79
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +6 -0
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +45 -31
- package/src/renderers/webgpu/utils/WebGPUConstants.js +7 -1
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +5 -5
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +12 -65
- package/src/renderers/webgpu/utils/WebGPUUtils.js +2 -17
- package/src/renderers/webxr/WebXRDepthSensing.js +6 -10
- package/src/renderers/webxr/WebXRManager.js +68 -6
- package/src/textures/ExternalTexture.js +45 -0
- package/src/textures/FramebufferTexture.js +2 -2
- package/src/textures/Source.js +11 -1
- package/src/textures/VideoTexture.js +30 -2
- package/src/nodes/utils/EquirectUVNode.js +0 -65
- package/src/nodes/utils/MatcapUVNode.js +0 -49
- package/src/nodes/utils/TriplanarTexturesNode.js +0 -148
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
class Block {
|
|
2
|
+
|
|
3
|
+
constructor( node, parent = null ) {
|
|
4
|
+
|
|
5
|
+
this.node = node;
|
|
6
|
+
this.parent = parent;
|
|
7
|
+
|
|
8
|
+
this.properties = {};
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
setProperty( name, value ) {
|
|
13
|
+
|
|
14
|
+
this.properties[ name ] = value;
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
getProperty( name ) {
|
|
19
|
+
|
|
20
|
+
let value = this.properties[ name ];
|
|
21
|
+
|
|
22
|
+
if ( value === undefined && this.parent !== null ) {
|
|
23
|
+
|
|
24
|
+
value = this.parent.getProperty( name );
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return value;
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
class Linker {
|
|
35
|
+
|
|
36
|
+
constructor() {
|
|
37
|
+
|
|
38
|
+
this.block = null;
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
addBlock( node ) {
|
|
43
|
+
|
|
44
|
+
this.block = new Block( node, this.block );
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
removeBlock( node ) {
|
|
49
|
+
|
|
50
|
+
if ( this.block === null || this.block.node !== node ) {
|
|
51
|
+
|
|
52
|
+
throw new Error( 'No block to remove or block mismatch.' );
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
this.block = this.block.parent;
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
processVariables( node ) {
|
|
61
|
+
|
|
62
|
+
this.block.setProperty( node.name, node );
|
|
63
|
+
|
|
64
|
+
if ( node.value ) {
|
|
65
|
+
|
|
66
|
+
this.processExpression( node.value );
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
processUniform( node ) {
|
|
73
|
+
|
|
74
|
+
this.block.setProperty( node.name, node );
|
|
75
|
+
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
processVarying( node ) {
|
|
79
|
+
|
|
80
|
+
this.block.setProperty( node.name, node );
|
|
81
|
+
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
evalProperty( node ) {
|
|
85
|
+
|
|
86
|
+
let property = '';
|
|
87
|
+
|
|
88
|
+
if ( node.isAccessor ) {
|
|
89
|
+
|
|
90
|
+
property += node.property;
|
|
91
|
+
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return property;
|
|
95
|
+
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
processExpression( node ) {
|
|
99
|
+
|
|
100
|
+
if ( node.isAccessor ) {
|
|
101
|
+
|
|
102
|
+
const property = this.block.getProperty( this.evalProperty( node ) );
|
|
103
|
+
|
|
104
|
+
if ( property ) {
|
|
105
|
+
|
|
106
|
+
node.linker.reference = property;
|
|
107
|
+
|
|
108
|
+
property.linker.accesses.push( node );
|
|
109
|
+
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
} else if ( node.isNumber || node.isString ) {
|
|
113
|
+
|
|
114
|
+
// Process primitive values
|
|
115
|
+
|
|
116
|
+
} else if ( node.isOperator ) {
|
|
117
|
+
|
|
118
|
+
this.processExpression( node.left );
|
|
119
|
+
this.processExpression( node.right );
|
|
120
|
+
|
|
121
|
+
if ( node.isAssignment ) {
|
|
122
|
+
|
|
123
|
+
const property = this.block.getProperty( this.evalProperty( node.left ) );
|
|
124
|
+
|
|
125
|
+
if ( property ) {
|
|
126
|
+
|
|
127
|
+
property.linker.assignments.push( node );
|
|
128
|
+
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
} else if ( node.isFunctionCall ) {
|
|
134
|
+
|
|
135
|
+
for ( const param of node.params ) {
|
|
136
|
+
|
|
137
|
+
this.processExpression( param );
|
|
138
|
+
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
} else if ( node.isReturn ) {
|
|
142
|
+
|
|
143
|
+
if ( node.value ) this.processExpression( node.value );
|
|
144
|
+
|
|
145
|
+
} else if ( node.isDiscard || node.isBreak || node.isContinue ) {
|
|
146
|
+
|
|
147
|
+
// Process control flow
|
|
148
|
+
|
|
149
|
+
} else if ( node.isAccessorElements ) {
|
|
150
|
+
|
|
151
|
+
this.processExpression( node.object );
|
|
152
|
+
|
|
153
|
+
for ( const element of node.elements ) {
|
|
154
|
+
|
|
155
|
+
this.processExpression( element.value );
|
|
156
|
+
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
} else if ( node.isDynamicElement || node.isStaticElement ) {
|
|
160
|
+
|
|
161
|
+
this.processExpression( node.value );
|
|
162
|
+
|
|
163
|
+
} else if ( node.isFor || node.isWhile ) {
|
|
164
|
+
|
|
165
|
+
this.processForWhile( node );
|
|
166
|
+
|
|
167
|
+
} else if ( node.isSwitch ) {
|
|
168
|
+
|
|
169
|
+
this.processSwitch( node );
|
|
170
|
+
|
|
171
|
+
} else if ( node.isVariableDeclaration ) {
|
|
172
|
+
|
|
173
|
+
this.processVariables( node );
|
|
174
|
+
|
|
175
|
+
} else if ( node.isUniform ) {
|
|
176
|
+
|
|
177
|
+
this.processUniform( node );
|
|
178
|
+
|
|
179
|
+
} else if ( node.isVarying ) {
|
|
180
|
+
|
|
181
|
+
this.processVarying( node );
|
|
182
|
+
|
|
183
|
+
} else if ( node.isTernary ) {
|
|
184
|
+
|
|
185
|
+
this.processExpression( node.cond );
|
|
186
|
+
this.processExpression( node.left );
|
|
187
|
+
this.processExpression( node.right );
|
|
188
|
+
|
|
189
|
+
} else if ( node.isConditional ) {
|
|
190
|
+
|
|
191
|
+
this.processConditional( node );
|
|
192
|
+
|
|
193
|
+
} else if ( node.isUnary ) {
|
|
194
|
+
|
|
195
|
+
this.processExpression( node.expression );
|
|
196
|
+
|
|
197
|
+
if ( node.isAssignment ) {
|
|
198
|
+
|
|
199
|
+
if ( node.parent.hasAssignment !== true ) {
|
|
200
|
+
|
|
201
|
+
// optimize increment/decrement operator
|
|
202
|
+
// to avoid creating a new variable
|
|
203
|
+
|
|
204
|
+
node.after = false;
|
|
205
|
+
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const property = this.block.getProperty( this.evalProperty( node.expression ) );
|
|
209
|
+
|
|
210
|
+
if ( property ) {
|
|
211
|
+
|
|
212
|
+
property.linker.assignments.push( node );
|
|
213
|
+
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
processBody( body ) {
|
|
223
|
+
|
|
224
|
+
for ( const statement of body ) {
|
|
225
|
+
|
|
226
|
+
this.processExpression( statement );
|
|
227
|
+
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
processConditional( node ) {
|
|
233
|
+
|
|
234
|
+
this.processExpression( node.cond );
|
|
235
|
+
this.processBody( node.body );
|
|
236
|
+
|
|
237
|
+
let current = node;
|
|
238
|
+
|
|
239
|
+
while ( current.elseConditional ) {
|
|
240
|
+
|
|
241
|
+
if ( current.elseConditional.cond ) {
|
|
242
|
+
|
|
243
|
+
this.processExpression( current.elseConditional.cond );
|
|
244
|
+
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
this.processBody( current.elseConditional.body );
|
|
248
|
+
|
|
249
|
+
current = current.elseConditional;
|
|
250
|
+
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
processForWhile( node ) {
|
|
256
|
+
|
|
257
|
+
if ( node.initialization ) this.processExpression( node.initialization );
|
|
258
|
+
if ( node.condition ) this.processExpression( node.condition );
|
|
259
|
+
if ( node.afterthought ) this.processExpression( node.afterthought );
|
|
260
|
+
|
|
261
|
+
this.processBody( node.body );
|
|
262
|
+
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
processSwitch( switchNode ) {
|
|
266
|
+
|
|
267
|
+
this.processExpression( switchNode.discriminant );
|
|
268
|
+
|
|
269
|
+
for ( const switchCase of switchNode.cases ) {
|
|
270
|
+
|
|
271
|
+
if ( switchCase.isDefault !== true ) {
|
|
272
|
+
|
|
273
|
+
for ( const condition of switchCase.conditions ) {
|
|
274
|
+
|
|
275
|
+
this.processExpression( condition );
|
|
276
|
+
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
this.processBody( switchCase.body );
|
|
282
|
+
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
processFunction( node ) {
|
|
288
|
+
|
|
289
|
+
this.addBlock( node );
|
|
290
|
+
|
|
291
|
+
for ( const param of node.params ) {
|
|
292
|
+
|
|
293
|
+
this.block.setProperty( param.name, param );
|
|
294
|
+
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
this.processBody( node.body );
|
|
298
|
+
|
|
299
|
+
this.removeBlock( node );
|
|
300
|
+
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
process( ast ) {
|
|
304
|
+
|
|
305
|
+
this.addBlock( ast );
|
|
306
|
+
|
|
307
|
+
for ( const statement of ast.body ) {
|
|
308
|
+
|
|
309
|
+
if ( statement.isFunctionDeclaration ) {
|
|
310
|
+
|
|
311
|
+
this.processFunction( statement );
|
|
312
|
+
|
|
313
|
+
} else {
|
|
314
|
+
|
|
315
|
+
this.processExpression( statement );
|
|
316
|
+
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
this.removeBlock( ast );
|
|
322
|
+
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export default Linker;
|