From ceea59b30db7408f0d74ae7c7a41a2809787587a Mon Sep 17 00:00:00 2001 From: jos Date: Fri, 30 Sep 2016 17:05:23 +0200 Subject: [PATCH] Aways package jsonlint, it's essential. Also some small fixes. --- gulpfile.js | 1 - src/TreeMode.js | 4 ++-- src/assets/jsonlint/jsonlint.js | 8 ++++++-- src/develop.html | 2 +- src/utils/empty.js | 3 ++- src/utils/jsonUtils.js | 6 +++--- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index c437ef6..e7005de 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -71,7 +71,6 @@ var compilerMinimalist = webpack({ bannerPlugin, new webpack.NormalModuleReplacementPlugin(new RegExp('^brace$'), EMPTY), new webpack.NormalModuleReplacementPlugin(new RegExp('^ajv'), EMPTY), - new webpack.NormalModuleReplacementPlugin(new RegExp('jsonlint$'), EMPTY), new webpack.optimize.UglifyJsPlugin() // TODO: don't minify when watching ], module: { diff --git a/src/TreeMode.js b/src/TreeMode.js index 78f3907..df07443 100644 --- a/src/TreeMode.js +++ b/src/TreeMode.js @@ -198,9 +198,9 @@ export default class TreeMode extends Component { */ handlePatch = (actions) => { // apply changes - const revert = this.patch(actions) + const result = this.patch(actions) - this.emitOnChange (actions, revert) + this.emitOnChange (actions, result.revert) } /** @private */ diff --git a/src/assets/jsonlint/jsonlint.js b/src/assets/jsonlint/jsonlint.js index fdb559d..36952fb 100644 --- a/src/assets/jsonlint/jsonlint.js +++ b/src/assets/jsonlint/jsonlint.js @@ -2,7 +2,7 @@ * Jison generated parser * Refactored into an ES6 module **/ -export var parser = (function(){ +var parser = (function(){ var parser = {trace: function trace() { }, yy: {}, symbols_: {"error":2,"JSONString":3,"STRING":4,"JSONNumber":5,"NUMBER":6,"JSONNullLiteral":7,"NULL":8,"JSONBooleanLiteral":9,"TRUE":10,"FALSE":11,"JSONText":12,"JSONValue":13,"EOF":14,"JSONObject":15,"JSONArray":16,"{":17,"}":18,"JSONMemberList":19,"JSONMember":20,":":21,",":22,"[":23,"]":24,"JSONElementList":25,"$accept":0,"$end":1}, @@ -417,4 +417,8 @@ export var parser = (function(){ return parser; })(); -export var parse = parser.parse.bind(parser); + +export default { + parse: parser.parse.bind(parser), + parser +} diff --git a/src/develop.html b/src/develop.html index 0467030..5d9bfb6 100644 --- a/src/develop.html +++ b/src/develop.html @@ -7,7 +7,7 @@ - +