From d52aba0b4ec95750129b5aeab88a6df36f18d052 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Wed, 24 Oct 2018 13:05:09 +0100 Subject: [PATCH] Rename cacheAsset to better reflect what it does --- src/lib/file-uploader.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/file-uploader.js b/src/lib/file-uploader.js index 481685684..f399bc214 100644 --- a/src/lib/file-uploader.js +++ b/src/lib/file-uploader.js @@ -51,7 +51,7 @@ const handleFileUpload = function (fileInput, onload) { */ /** - * Cache an asset (costume, sound) in storage and return an object representation + * Create an asset (costume, sound) with storage and return an object representation * of the asset to track in the VM. * @param {ScratchStorage} storage The storage to cache the asset in * @param {string} fileName The name of the asset @@ -62,7 +62,7 @@ const handleFileUpload = function (fileInput, onload) { * @return {VMAsset} An object representing this asset and relevant information * which can be used to look up the data in storage */ -const cacheAsset = function (storage, fileName, assetType, dataFormat, data) { +const createVMAsset = function (storage, fileName, assetType, dataFormat, data) { const asset = storage.createAsset( assetType, dataFormat, @@ -117,7 +117,7 @@ const costumeUpload = function (fileData, fileType, costumeName, storage, handle const bitmapAdapter = new BitmapAdapter(); const addCostumeFromBuffer = function (dataBuffer) { - const vmCostume = cacheAsset( + const vmCostume = createVMAsset( storage, costumeName, assetType, @@ -173,7 +173,7 @@ const soundUpload = function (fileData, fileType, soundName, storage, handleSoun return; } - const vmSound = cacheAsset( + const vmSound = createVMAsset( storage, soundName, storage.AssetType.Sound,