codemirror
Advanced tools
Comparing version 3.17.0 to 3.18.0
(function () { | ||
"use strict"; | ||
function forEach(arr, f) { | ||
@@ -48,3 +50,3 @@ for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); | ||
CodeMirror.pigHint = pigHint; // deprecated | ||
CodeMirror.registerHelper("hint", "pig", hinter); | ||
CodeMirror.registerHelper("hint", "pig", pigHint); | ||
@@ -51,0 +53,0 @@ var pigKeywords = "VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP " |
// Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js | ||
// declare global: coffeelint | ||
CodeMirror.registerHelper("lint", "coffeescript", function(text) { | ||
@@ -4,0 +6,0 @@ var found = []; |
// Depends on csslint.js from https://github.com/stubbornella/csslint | ||
// declare global: CSSLint | ||
CodeMirror.registerHelper("lint", "css", function(text) { | ||
@@ -4,0 +6,0 @@ var found = []; |
(function() { | ||
"use strict"; | ||
// declare global: JSHINT | ||
@@ -3,0 +5,0 @@ var bogus = [ "Dangerous comment" ]; |
// Depends on jsonlint.js from https://github.com/zaach/jsonlint | ||
// declare global: jsonlint | ||
CodeMirror.registerHelper("lint", "json", function(text) { | ||
@@ -4,0 +6,0 @@ var found = []; |
(function() { | ||
"use strict"; | ||
// declare global: diff_match_patch, DIFF_INSERT, DIFF_DELETE, DIFF_EQUAL | ||
@@ -4,0 +5,0 @@ var Pos = CodeMirror.Pos; |
@@ -5,2 +5,5 @@ /* Just enough of CodeMirror to run runMode under node.js */ | ||
(function() { | ||
"use strict"; | ||
function splitLines(string){ return string.split(/\r?\n|\r/); }; | ||
@@ -134,1 +137,2 @@ | ||
}; | ||
})(); |
@@ -45,2 +45,3 @@ // Glue code between CodeMirror and Tern. | ||
"use strict"; | ||
// declare global: tern | ||
@@ -613,3 +614,3 @@ CodeMirror.TernServer = function(options) { | ||
if (data.type == "getFile") { | ||
getFile(ts, name, function(err, text) { | ||
getFile(ts, data.name, function(err, text) { | ||
send({type: "getFile", err: String(err), text: text, id: data.id}); | ||
@@ -616,0 +617,0 @@ }); |
@@ -0,1 +1,3 @@ | ||
// declare global: tern, server | ||
var server; | ||
@@ -2,0 +4,0 @@ |
{ | ||
"name": "CodeMirror", | ||
"version": "3.17.0", | ||
"version": "3.18.0", | ||
"main": ["lib/codemirror.js", "lib/codemirror.css"], | ||
@@ -5,0 +5,0 @@ "ignore": [ |
@@ -356,3 +356,3 @@ (function() { | ||
"Ctrl-S": "save", "Ctrl-W": "save", "S": "saveAll", "F": "open", "U": repeated("undo"), "K": "close", | ||
"Delete": function(cm) { kill(cm, cm.getCursor(), sentenceEnd(cm, 1), true); }, | ||
"Delete": function(cm) { kill(cm, cm.getCursor(), bySentence(cm, cm.getCursor(), 1), true); }, | ||
auto: "emacs", nofallthrough: true, disableInput: true | ||
@@ -359,0 +359,0 @@ }; |
@@ -300,3 +300,3 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) { | ||
if(type == "variable") return cont(metadef); | ||
if(type == "(") return cont(pushlex(")"), comasep(metaargs, ")"), poplex, statement); | ||
if(type == "(") return cont(pushlex(")"), commasep(metaargs, ")"), poplex, statement); | ||
} | ||
@@ -303,0 +303,0 @@ function metaargs(type) { |
@@ -358,10 +358,12 @@ CodeMirror.defineMode("python", function(conf, parserConf) { | ||
var words = function(str){return str.split(' ');}; | ||
(function() { | ||
"use strict"; | ||
var words = function(str){return str.split(' ');}; | ||
CodeMirror.defineMIME("text/x-cython", { | ||
name: "python", | ||
extra_keywords: words("by cdef cimport cpdef ctypedef enum except"+ | ||
"extern gil include nogil property public"+ | ||
"readonly struct union DEF IF ELIF ELSE") | ||
}); | ||
CodeMirror.defineMIME("text/x-cython", { | ||
name: "python", | ||
extra_keywords: words("by cdef cimport cpdef ctypedef enum except"+ | ||
"extern gil include nogil property public"+ | ||
"readonly struct union DEF IF ELIF ELSE") | ||
}); | ||
})(); |
@@ -1,23 +0,1 @@ | ||
/* | ||
Copyright (C) 2011 by MarkLogic Corporation | ||
Author: Mike Brevoort <mike@brevoort.com> | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
*/ | ||
CodeMirror.defineMode("xquery", function() { | ||
@@ -351,3 +329,3 @@ | ||
if(!isInXmlAttributeBlock(state)) | ||
pushStateStack(state, { type: "attribute", name: name, tokenize: tokenAttribute}); | ||
pushStateStack(state, { type: "attribute", tokenize: tokenAttribute}); | ||
@@ -354,0 +332,0 @@ stream.eat(/[a-zA-Z_:]/); |
{ | ||
"name": "codemirror", | ||
"version":"3.17.0", | ||
"version":"3.18.0", | ||
"main": "lib/codemirror.js", | ||
@@ -5,0 +5,0 @@ "description": "In-browser code editing made bearable", |
@@ -11,2 +11,5 @@ /* | ||
- assigning to a variable you didn't declare | ||
- access to non-whitelisted globals | ||
(use a '// declare global: foo, bar' comment to declare extra | ||
globals in a file) | ||
@@ -16,2 +19,11 @@ [1]: https://github.com/marijnh/acorn/ | ||
var topAllowedGlobals = Object.create(null); | ||
("Error RegExp Number String Array Function Object Math Date undefined " + | ||
"parseInt parseFloat Infinity NaN isNaN " + | ||
"window document navigator prompt alert confirm console " + | ||
"FileReader Worker postMessage importScripts " + | ||
"setInterval clearInterval setTimeout clearTimeout " + | ||
"CodeMirror test") | ||
.split(" ").forEach(function(n) { topAllowedGlobals[n] = true; }); | ||
var fs = require("fs"), acorn = require("./acorn.js"), walk = require("./walk.js"); | ||
@@ -33,2 +45,4 @@ | ||
} | ||
var globalsSeen = Object.create(null); | ||
@@ -76,2 +90,3 @@ try { | ||
Identifier: function(node, scope) { | ||
if (node.name == "arguments") return; | ||
// Mark used identifiers | ||
@@ -83,2 +98,3 @@ for (var cur = scope; cur; cur = cur.prev) | ||
} | ||
globalsSeen[node.name] = node.loc; | ||
}, | ||
@@ -90,2 +106,13 @@ FunctionExpression: function(node) { | ||
if (!globalsSeen.exports) { | ||
var allowedGlobals = Object.create(topAllowedGlobals), m; | ||
if (m = file.match(/\/\/ declare global:\s+(.*)/)) | ||
m[1].split(/,\s*/g).forEach(function(n) { allowedGlobals[n] = true; }); | ||
for (var glob in globalsSeen) | ||
if (!(glob in allowedGlobals)) | ||
fail("Access to global variable " + glob + ". Add a '// declare global: " + glob + | ||
"' comment or add this variable in test/lint/lint.js.", globalsSeen[glob]); | ||
} | ||
for (var i = 0; i < scopes.length; ++i) { | ||
@@ -92,0 +119,0 @@ var scope = scopes[i]; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2367694
39192