From e4d7de76e391f9af6222f5374a4fef1a99c25f5a Mon Sep 17 00:00:00 2001 From: Simon Williams Date: Thu, 13 Oct 2016 13:20:11 -0600 Subject: [PATCH] fix canvas_i18nliner issue, along with its tests it broke in the node upgrade (though fortunately not a feature we use), and the tests were silently failing test plan: n/a, specs Change-Id: Ib746b91e7500a31d8a8fb210af5afe8018c1dda3 Reviewed-on: https://gerrit.instructure.com/92764 Reviewed-by: Simon Williams Reviewed-by: Jon Jensen Product-Review: Jon Jensen QA-Review: Jon Jensen Tested-by: Jenkins --- gems/canvas_i18nliner/.i18nrc | 5 +++++ .../canvas_i18nliner/js/scoped_i18n_js_extractor.js | 13 +++++-------- gems/canvas_i18nliner/npm-shrinkwrap.json | 6 +++--- gems/canvas_i18nliner/package.json | 4 ++-- 4 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 gems/canvas_i18nliner/.i18nrc diff --git a/gems/canvas_i18nliner/.i18nrc b/gems/canvas_i18nliner/.i18nrc new file mode 100644 index 00000000000..6c64b2fc6a7 --- /dev/null +++ b/gems/canvas_i18nliner/.i18nrc @@ -0,0 +1,5 @@ +{ + "plugins": [ + "i18nliner-handlebars" + ] +} \ No newline at end of file diff --git a/gems/canvas_i18nliner/js/scoped_i18n_js_extractor.js b/gems/canvas_i18nliner/js/scoped_i18n_js_extractor.js index f122f9e2fc7..cdc3a37b69e 100644 --- a/gems/canvas_i18nliner/js/scoped_i18n_js_extractor.js +++ b/gems/canvas_i18nliner/js/scoped_i18n_js_extractor.js @@ -14,9 +14,12 @@ ScopedI18nJsExtractor.prototype = Object.create(I18nJsExtractor.prototype); ScopedI18nJsExtractor.prototype.constructor = ScopedI18nJsExtractor; -ScopedI18nJsExtractor.prototype.processCall = function(node) { +ScopedI18nJsExtractor.prototype.processCall = function(node, traverse) { this.inferI18nScope(node); - I18nJsExtractor.prototype.processCall.call(this, node); + I18nJsExtractor.prototype.processCall.call(this, node, traverse); + if (this.i18nScope && this.i18nScope.node === node) { + this.popI18nScope(); + } }; ScopedI18nJsExtractor.prototype.inferI18nScope = function(node) { @@ -48,12 +51,6 @@ ScopedI18nJsExtractor.prototype.inferI18nScope = function(node) { } }; -ScopedI18nJsExtractor.prototype.leave = function(node) { - if (this.i18nScope && this.i18nScope.node === node) { - this.popI18nScope(); - } -}; - ScopedI18nJsExtractor.prototype.pushI18nScope = function(scope) { var stack = this.i18nScopeStack = this.i18nScopeStack || []; stack.push(scope); diff --git a/gems/canvas_i18nliner/npm-shrinkwrap.json b/gems/canvas_i18nliner/npm-shrinkwrap.json index f2d2438fe2b..9840729af61 100644 --- a/gems/canvas_i18nliner/npm-shrinkwrap.json +++ b/gems/canvas_i18nliner/npm-shrinkwrap.json @@ -404,9 +404,9 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz" }, "i18nliner": { - "version": "0.1.5", - "from": "i18nliner@0.1.5", - "resolved": "https://registry.npmjs.org/i18nliner/-/i18nliner-0.1.5.tgz" + "version": "0.1.6", + "from": "i18nliner@0.1.6", + "resolved": "https://registry.npmjs.org/i18nliner/-/i18nliner-0.1.6.tgz" }, "i18nliner-handlebars": { "version": "0.2.0", diff --git a/gems/canvas_i18nliner/package.json b/gems/canvas_i18nliner/package.json index 8ef492355cd..52c4d4ddaae 100644 --- a/gems/canvas_i18nliner/package.json +++ b/gems/canvas_i18nliner/package.json @@ -8,7 +8,7 @@ "ember-template-compiler": "1.8.0", "glob": "^7.0.3", "handlebars": "1.3.0", - "i18nliner": "0.1.5", + "i18nliner": "0.1.6", "i18nliner-handlebars": "0.2.0", "minimist": "^1.1.0", "mkdirp": "^0.5.1" @@ -17,6 +17,6 @@ "jasmine-node": "^1.14.5" }, "scripts": { - "test": "./node_modules/.bin/jasmine-node ./test" + "test": "./node_modules/.bin/jasmine-node --captureExceptions ./test" } }