Don't use "objects" in lib/compiler/index.js

The "objects" module will be removed.

See #442.
redux
David Majda 8 years ago
parent c344460855
commit 97d92c9d8b

@ -1,6 +1,20 @@
"use strict";
let objects = require("../utils/objects");
function processOptions(options, defaults) {
let processedOptions = {};
Object.keys(options).forEach(name => {
processedOptions[name] = options[name];
});
Object.keys(defaults).forEach(name => {
if (!processedOptions.hasOwnProperty(name)) {
processedOptions[name] = defaults[name];
}
});
return processedOptions;
}
let compiler = {
/*
@ -42,8 +56,7 @@ let compiler = {
compile: function(ast, passes, options) {
options = options !== undefined ? options : {};
options = objects.clone(options);
objects.defaults(options, {
options = processOptions(options, {
allowedStartRules: [ast.rules[0].name],
cache: false,
dependencies: {},

Loading…
Cancel
Save