This commit is contained in:
William Candillon 2014-04-03 14:16:15 +02:00 • committed by nightwing
commit cbd66efbf3
2 changed files with 11 additions and 6 deletions

View file

@ -78653,8 +78653,14 @@ exports.TreeOps = {
},
{}],
11:[function(_dereq_,module,exports){
'use strict';
var createStaticContext = exports.createStaticContext = function(){
var StaticContext = _dereq_('./compiler/static_context').StaticContext;
return new StaticContext();
};
exports.XQLint = function (source, opts) {
'use strict';
opts = opts ? opts : {};
@ -78663,7 +78669,6 @@ exports.XQLint = function (source, opts) {
var JSONParseTreeHandler = _dereq_('./parsers/JSONParseTreeHandler').JSONParseTreeHandler;
var Translator = _dereq_('./compiler/translator').Translator;
var StyleChecker = _dereq_('./formatter/style_checker').StyleChecker;
var StaticContext = _dereq_('./compiler/static_context').StaticContext;
var completer = _dereq_('../lib/completion/completer');
var defaults = function(current, def){
@ -78735,7 +78740,7 @@ exports.XQLint = function (source, opts) {
return pos;
};
var sctx = opts.staticContext ? opts.staticContext : new StaticContext();
var sctx = opts.staticContext ? opts.staticContext : createStaticContext();
var file = opts.fileName ? opts.fileName : '';
var isJSONiq = ((file.substring(file.length - '.jq'.length).indexOf('.jq') !== -1) && source.indexOf('xquery version') !== 0) || source.indexOf('jsoniq version') === 0;
var h = new JSONParseTreeHandler(source);

View file

@ -33,15 +33,15 @@ define(function(require, exports, module) {
var oop = require("../lib/oop");
var Mirror = require("../worker/mirror").Mirror;
var XQLint = require("./xquery/xqlint").XQLint;
var StaticContext = require("./xquery/xqlint").StaticContext;
var XQLintLib = require("./xquery/xqlint");
var XQLint = XQLintLib.XQLint;
var XQueryWorker = exports.XQueryWorker = function(sender) {
Mirror.call(this, sender);
this.setTimeout(200);
this.opts = {
styleCheck: false,
sctx: new StaticContext()
staticContext: XQLintLib.createStaticContext()
};
var that = this;