From d2569b9bf3d4b8843d4a0e82de2e1681e16fd27a Mon Sep 17 00:00:00 2001 From: David Majda Date: Wed, 14 Sep 2016 13:42:44 +0200 Subject: [PATCH] Don't use "objects" in lib/compiler/passes/generate-js.js The "objects" module will be removed. See #442. --- lib/compiler/passes/generate-js.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/compiler/passes/generate-js.js b/lib/compiler/passes/generate-js.js index b7563ee..342d6a3 100644 --- a/lib/compiler/passes/generate-js.js +++ b/lib/compiler/passes/generate-js.js @@ -1,7 +1,6 @@ "use strict"; -let objects = require("../../utils/objects"), - asts = require("../asts"), +let asts = require("../asts"), op = require("../opcodes"), js = require("../js"); @@ -1279,8 +1278,8 @@ function generateJS(ast, options) { }, amd: function() { - let dependencyIds = objects.values(options.dependencies), - dependencyVars = Object.keys(options.dependencies), + let dependencyVars = Object.keys(options.dependencies), + dependencyIds = dependencyIds.map(v => options.dependencies[v]), dependencies = '[' + dependencyIds.map( id => '"' + js.stringEscape(id) + '"' @@ -1317,8 +1316,8 @@ function generateJS(ast, options) { umd: function() { let parts = [], - dependencyIds = objects.values(options.dependencies), dependencyVars = Object.keys(options.dependencies), + dependencyIds = dependencyIds.map(v => options.dependencies[v]), dependencies = '[' + dependencyIds.map( id => '"' + js.stringEscape(id) + '"'