diff --git a/api/router.js b/api/router.js index 96cf56f89..fdf4ed8a3 100644 --- a/api/router.js +++ b/api/router.js @@ -6,7 +6,6 @@ var m = require("../render/hyperscript") var buildPathname = require("../pathname/build") var parsePathname = require("../pathname/parse") var compileTemplate = require("../pathname/compileTemplate") -var assign = require("../util/assign") var censor = require("../util/censor") var sentinel = {} @@ -78,7 +77,7 @@ module.exports = function($window, mountRedraw) { .slice(route.prefix.length) var data = parsePathname(path) - assign(data.params, $window.history.state) + Object.assign(data.params, $window.history.state) function reject(e) { console.error(e) diff --git a/pathname/build.js b/pathname/build.js index 848e3841d..3cd033c3e 100644 --- a/pathname/build.js +++ b/pathname/build.js @@ -1,7 +1,6 @@ "use strict" var buildQueryString = require("../querystring/build") -var assign = require("../util/assign") // Returns `path` from `template` + `params` module.exports = function(template, params) { @@ -16,7 +15,7 @@ module.exports = function(template, params) { var path = template.slice(0, pathEnd) var query = {} - assign(query, params) + Object.assign(query, params) var resolved = path.replace(/:([^\/\.-]+)(\.{3})?/g, function(m, key, variadic) { delete query[key] diff --git a/render/hyperscript.js b/render/hyperscript.js index a40004131..8b34233e9 100644 --- a/render/hyperscript.js +++ b/render/hyperscript.js @@ -3,7 +3,6 @@ var Vnode = require("../render/vnode") var hyperscriptVnode = require("./hyperscriptVnode") var hasOwn = require("../util/hasOwn") -var assign = require("../util/assign") var selectorParser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g var selectorCache = Object.create(null) @@ -40,7 +39,7 @@ function execSelector(state, vnode) { vnode.tag = state.tag if (state.attrs != null) { - attrs = assign({}, state.attrs, attrs) + attrs = Object.assign({}, state.attrs, attrs) if (className != null || state.attrs.className != null) attrs.className = className != null @@ -60,7 +59,7 @@ function execSelector(state, vnode) { // The DOM does things to inputs based on the "type", so it needs set first. // See: https://github.com/MithrilJS/mithril.js/issues/2622 if (state.tag === "input" && hasOwn.call(attrs, "type")) { - attrs = assign({type: attrs.type}, attrs) + attrs = Object.assign({type: attrs.type}, attrs) } vnode.attrs = attrs diff --git a/util/assign.js b/util/assign.js deleted file mode 100644 index 38a421f3f..000000000 --- a/util/assign.js +++ /dev/null @@ -1,4 +0,0 @@ -// This exists so I'm only saving it once. -"use strict" - -module.exports = Object.assign