From a1438e68464c5744d7013366300e2d25347b47b0 Mon Sep 17 00:00:00 2001 From: Alexandre Santos Date: Mon, 3 Jun 2019 21:38:48 +0100 Subject: [PATCH] Change code to es5 --- lib/ace/mode/yaml/yaml-lint.js | 52 +++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/lib/ace/mode/yaml/yaml-lint.js b/lib/ace/mode/yaml/yaml-lint.js index d8976f00c14..aacd025a7bc 100644 --- a/lib/ace/mode/yaml/yaml-lint.js +++ b/lib/ace/mode/yaml/yaml-lint.js @@ -1,19 +1,19 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.lint = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i { + return new window.Promise(function(resolve, reject) { try { yaml.safeLoad(content, { schema: yaml[options.schema] @@ -27,14 +27,14 @@ function lint(content, opts) { } function lintFile(file, opts) { - return new Promise((resolve, reject) => { - fs.readFile(file, 'utf8', (err, content) => { + return new window.Promise(function (resolve, reject) { + fs.readFile(file, 'utf8', function (err, content) { if (err) { reject(err); } else { - lint(content, opts).then((result) => { + lint(content, opts).then(function (result) { resolve(result); - }).catch((e) => { + }).catch(function(e) { reject(e); }); } @@ -343,10 +343,10 @@ function isWhitespace(c) { // should also be escaped. [However,] This isn’t mandatory" // Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. function isPrintable(c) { - return (0x00020 <= c && c <= 0x00007E) - || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) - || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) - || (0x10000 <= c && c <= 0x10FFFF); + return (c >= 0x00020 && c <= 0x00007E) + || ((c >= 0x000A1 && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((c >= 0x0E000 && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) + || (c >= 0x10000 && c <= 0x10FFFF); } // Simplified test for values allowed after the first character in plain style. @@ -1091,14 +1091,14 @@ function is_FLOW_INDICATOR(c) { function fromHexCode(c) { var lc; - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + if ((c/* 0 */ >= 0x30) && (c <= 0x39/* 9 */)) { return c - 0x30; } /*eslint-disable no-bitwise*/ lc = c | 0x20; - if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { + if ((lc/* a */ >= 0x61) && (lc <= 0x66/* f */)) { return lc - 0x61 + 10; } @@ -1113,7 +1113,7 @@ function escapedHexLen(c) { } function fromDecimalCode(c) { - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + if ((c/* 0 */ >= 0x30) && (c <= 0x39/* 9 */)) { return c - 0x30; } @@ -1286,7 +1286,7 @@ function captureSegment(state, start, end, checkJson) { for (_position = 0, _length = _result.length; _position < _length; _position += 1) { _character = _result.charCodeAt(_position); if (!(_character === 0x09 || - (0x20 <= _character && _character <= 0x10FFFF))) { + (_character >= 0x20 && _character <= 0x10FFFF))) { throwError(state, 'expected valid JSON character'); } } @@ -3308,17 +3308,17 @@ var common = require('../common'); var Type = require('../type'); function isHexCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || - ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || - ((0x61/* a */ <= c) && (c <= 0x66/* f */)); + return ((c/* 0 */ >= 0x30) && (c <= 0x39/* 9 */)) || + ((c/* A */ >= 0x41) && (c <= 0x46/* F */)) || + ((c/* a */ >= 0x61) && (c <= 0x66/* f */)); } function isOctCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); + return ((c/* 0 */ >= 0x30) && (c <= 0x37/* 7 */)); } function isDecCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); + return ((c/* 0 */ >= 0x30) && (c <= 0x39/* 9 */)); } function resolveYamlInteger(data) { @@ -5930,6 +5930,6 @@ function stubFalse() { module.exports = merge; -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}]},{},[2])(2) +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}); +},{}]},{},[2])(2); });