Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

OS-858 add experimental support for VM.send, VM.receive, VM.install t…

…o VM.js and vmadm

OS-952 started update of illumos-live toward JEG
STOR-33 added VM.send and VM.receive to serve as a start toward backup/restore
  • Loading branch information...
commit 96cc0edb8c8312e56ef07fd8171812abc1693948 1 parent 2bbea55
@joshwilsdon joshwilsdon authored
Showing with 3,119 additions and 13,041 deletions.
  1. +4 −0 .gitignore
  2. +5 −5 Makefile
  3. +33 −5 src/Makefile
  4. +3 −0  src/manifest
  5. +3 −11 src/qemu-exec.c
  6. +0 −48 src/tools/node-lint.json
  7. +0 −9 src/tools/node-lint/.externalToolBuilders/Vows.launch
  8. +0 −27 src/tools/node-lint/.project
  9. +0 −6 src/tools/node-lint/.settings/.jsdtscope
  10. +0 −3  src/tools/node-lint/.settings/org.eclipse.core.resources.prefs
  11. +0 −3  src/tools/node-lint/.settings/org.eclipse.core.runtime.prefs
  12. +0 −1  src/tools/node-lint/.settings/org.eclipse.wst.jsdt.ui.superType.container
  13. +0 −1  src/tools/node-lint/.settings/org.eclipse.wst.jsdt.ui.superType.name
  14. +0 −21 src/tools/node-lint/LICENSE
  15. +0 −57 src/tools/node-lint/Makefile
  16. +0 −171 src/tools/node-lint/README.md
  17. +0 −127 src/tools/node-lint/bin/node-lint
  18. +0 −163 src/tools/node-lint/doc/node-lint.md
  19. +0 −50 src/tools/node-lint/etc/config.json
  20. +0 −52 src/tools/node-lint/examples/emacs/flymake-nodelint.el
  21. +0 −31 src/tools/node-lint/lib/assert/extension.js
  22. +0 −20 src/tools/node-lint/lib/eyes/LICENSE
  23. +0 −4 src/tools/node-lint/lib/eyes/Makefile
  24. +0 −72 src/tools/node-lint/lib/eyes/README.md
  25. +0 −1  src/tools/node-lint/lib/eyes/eyes.js
  26. +0 −233 src/tools/node-lint/lib/eyes/lib/eyes.js
  27. +0 −14 src/tools/node-lint/lib/eyes/package.json
  28. +0 −55 src/tools/node-lint/lib/eyes/test/eyes-test.js
  29. +0 −336 src/tools/node-lint/lib/lint/formatter.js
  30. +0 −70 src/tools/node-lint/lib/lint/formatter/callback.js
  31. +0 −365 src/tools/node-lint/lib/lint/formatter/cli.js
  32. +0 −365 src/tools/node-lint/lib/lint/formatter/cli.js.bak
  33. +0 −36 src/tools/node-lint/lib/lint/formatter/json.js
  34. +0 −220 src/tools/node-lint/lib/lint/formatter/textmate.js
  35. +0 −47 src/tools/node-lint/lib/lint/formatter/vim.js
  36. +0 −114 src/tools/node-lint/lib/lint/formatter/xml.js
  37. +0 −18 src/tools/node-lint/lib/lint/index.js
  38. +0 −5,724 src/tools/node-lint/lib/lint/jslint.js
  39. +0 −531 src/tools/node-lint/lib/lint/launcher.js
  40. +0 −238 src/tools/node-lint/lib/lint/parser.js
  41. +0 −76 src/tools/node-lint/lib/lint/vows.js
  42. +0 −20 src/tools/node-lint/lib/vows/LICENSE
  43. +0 −7 src/tools/node-lint/lib/vows/Makefile
  44. +0 −39 src/tools/node-lint/lib/vows/README.md
  45. +0 −1  src/tools/node-lint/lib/vows/assert
  46. +0 −421 src/tools/node-lint/lib/vows/bin/vows
  47. +0 −27 src/tools/node-lint/lib/vows/lib/assert/error.js
  48. +0 −192 src/tools/node-lint/lib/vows/lib/assert/macros.js
  49. +0 −77 src/tools/node-lint/lib/vows/lib/assert/utils.js
  50. +0 −195 src/tools/node-lint/lib/vows/lib/vows.js
  51. +0 −93 src/tools/node-lint/lib/vows/lib/vows/console.js
  52. +0 −55 src/tools/node-lint/lib/vows/lib/vows/context.js
  53. +0 −28 src/tools/node-lint/lib/vows/lib/vows/extras.js
  54. +0 −69 src/tools/node-lint/lib/vows/lib/vows/reporters/dot-matrix.js
  55. +0 −10 src/tools/node-lint/lib/vows/lib/vows/reporters/json.js
  56. +0 −8 src/tools/node-lint/lib/vows/lib/vows/reporters/silent.js
  57. +0 −74 src/tools/node-lint/lib/vows/lib/vows/reporters/spec.js
  58. +0 −38 src/tools/node-lint/lib/vows/lib/vows/reporters/watch.js
  59. +0 −90 src/tools/node-lint/lib/vows/lib/vows/reporters/xunit.js
  60. +0 −321 src/tools/node-lint/lib/vows/lib/vows/suite.js
  61. +0 −14 src/tools/node-lint/lib/vows/package.json
  62. +0 −106 src/tools/node-lint/lib/vows/test/assert-test.js
  63. +0 −373 src/tools/node-lint/lib/vows/test/vows-test.js
  64. +0 −1  src/tools/node-lint/lib/vows/vows
  65. +0 −1  src/tools/node-lint/lib/vows/vows.js
  66. +0 −365 src/tools/node-lint/man1/node-lint.1
  67. +0 −45 src/tools/node-lint/package.json
  68. +0 −3  src/tools/node-lint/resource/fixture/invalid-test.js
  69. +0 −3  src/tools/node-lint/resource/fixture/valid-test.js
  70. +0 −61 src/tools/node-lint/test/assert/extension-test.js
  71. +0 −64 src/tools/node-lint/test/lint/formatter-test.js
  72. +0 −75 src/tools/node-lint/test/lint/formatter/callback-test.js
  73. +0 −86 src/tools/node-lint/test/lint/formatter/cli-test.js
  74. +0 −57 src/tools/node-lint/test/lint/formatter/json-test.js
  75. +0 −57 src/tools/node-lint/test/lint/formatter/textmate-test.js
  76. +0 −57 src/tools/node-lint/test/lint/formatter/vim-test.js
  77. +0 −94 src/tools/node-lint/test/lint/formatter/xml-test.js
  78. 0  src/tools/node-lint/test/lint/launcher-test.js
  79. +0 −181 src/tools/node-lint/test/lint/parser-test.js
  80. +108 −0 src/vm/README.migration
  81. +2 −0  src/vm/common/vmtest.js
  82. +7 −6 src/vm/etc/vmadm.completion
  83. +997 −231 src/vm/node_modules/VM.js
  84. +23 −1 src/vm/run-tests
  85. +2 −2 src/vm/sbin/build-user-script.js
  86. +54 −12 src/vm/sbin/vmadm.js
  87. +48 −28 src/vm/sbin/vmadmd.js
  88. +1 −1  src/vm/tests/test-50-creates.js
  89. +1 −2  src/vm/tests/test-autoboot.js
  90. +1 −2  src/vm/tests/test-defaults.js
  91. +1 −1  src/vm/tests/test-net-conflicts.js
  92. +1 −1  src/vm/tests/test-primary-flag.js
  93. +217 −0 src/vm/tests/test-send-recv.js
  94. +2 −1  src/vm/tests/test-update.js
  95. +387 −0 src/vmunbundle.c
  96. +142 −0 src/zfs_recv.c
  97. +118 −0 src/zfs_send.c
  98. +22 −15 src/zoneevent.c
  99. +937 −0 tools/cstyle
View
4 .gitignore
@@ -4,11 +4,15 @@
/projects
/proto
/log
+/src/*.o
/src/bootparams
/src/disk_size
/src/removable_disk
/src/disklist
/src/qemu-exec
+/src/vmunbundle
+/src/zfs_recv
+/src/zfs_send
/src/zoneevent
/src/vm/tests.tar.gz
/src/node-kstat/.lock-wscript
View
10 Makefile
@@ -9,6 +9,7 @@ MANIFEST=manifest.gen
OVERLAYS:=$(shell cat overlay/order)
JSSTYLE=$(ROOT)/tools/jsstyle/jsstyle
JSLINT=$(ROOT)/tools/javascriptlint/build/install/jsl
+CSTYLE=$(ROOT)/tools/cstyle
ifeq ($(EXTRA_TARBALL),)
EXTRA_TARBALL:=$(shell ls `pwd`/illumos-extra*.tgz 2> /dev/null | tail -n1 && echo $?)
endif
@@ -100,14 +101,13 @@ endif
tools/cryptpass: tools/cryptpass.c
(cd ${ROOT}/tools && gcc -Wall -W -O2 -o cryptpass cryptpass.c)
+jsl: $(JSLINT)
+
$(JSLINT):
@(cd $(ROOT)/tools/javascriptlint; make CC=gcc install)
check: $(JSLINT)
- @$(JSLINT) --conf=$(ROOT)/tools/jsl.node.conf src/vm/sbin/*.js
- @$(JSLINT) --conf=$(ROOT)/tools/jsl.node.conf src/vm/node_modules/{qmp,VM}.js
- @$(JSSTYLE) -o indent=4,strict-indent=1,doxygen,unparenthesized-return=0,continuation-at-front=1,leading-right-paren-ok=1 src/vm/sbin/*.js
- @$(JSSTYLE) -o indent=4,strict-indent=1,doxygen,unparenthesized-return=0,continuation-at-front=1,leading-right-paren-ok=1 src/vm/node_modules/{qmp,VM}.js
+ @(cd $(ROOT)/src && make check)
clean:
rm -f $(MANIFEST)
@@ -122,4 +122,4 @@ clean:
(cd $(ROOT) && mkdir -p $(PROTO))
rm -f 0-*-stamp
-.PHONY: manifest check
+.PHONY: manifest check jsl
View
38 src/Makefile
@@ -6,6 +6,11 @@ TARGETS=bootparams diskinfo disklist removable_disk disk_size \
node-syslog/build/Release/syslog.node \
node-zsock/build/Release/zsock_bindings.node \
node-zutil/build/Release/zutil_bindings.node \
+ vmunbundle zfs_send zfs_recv
+ROOT=$(PWD)/..
+JSSTYLE=$(ROOT)/tools/jsstyle/jsstyle
+JSLINT=$(ROOT)/tools/javascriptlint/build/install/jsl
+CSTYLE=$(ROOT)/tools/cstyle
SMARTDC_TARGETS=qemu-exec
DESTDIR=../proto
@@ -40,6 +45,9 @@ install: $(TARGETS) sysinfo
sed -e "s|var expat.*;|var expat = require('expat_binding');|" > \
$(DESTDIR)/usr/vm/node_modules/node-expat.js
cp zoneevent $(DESTDIR)/usr/vm/sbin/zoneevent
+ cp zfs_send $(DESTDIR)/usr/vm/sbin/zfs_send
+ cp zfs_recv $(DESTDIR)/usr/vm/sbin/zfs_recv
+ cp vmunbundle $(DESTDIR)/usr/vm/sbin/vmunbundle
mkdir -p $(DESTDIR)/lib/svc/manifest/system
cp vm/smf/system-vmadmd.xml $(DESTDIR)/lib/svc/manifest/system/system-vmadmd.xml
cp vm/smf/system-metadata.xml $(DESTDIR)/lib/svc/manifest/system/system-metadata.xml
@@ -50,10 +58,6 @@ install: $(TARGETS) sysinfo
cp -PR ds $(DESTDIR)/usr/
mkdir -m 0755 -p $(DESTDIR)/var/db/dsadm
-check:
- @tools/node-lint/bin/node-lint *.js \
- --config=tools/node-lint.json
-
bootparams: bootparams.c
$(CC) $(CFLAGS) -o $@ $^ -ldevinfo
@@ -69,6 +73,15 @@ disk_size: disk_size.c
qemu-exec: qemu-exec.c
$(CC) $(CFLAGS) -o $@ $^
+zfs_recv: zfs_recv.c
+ $(CC) $(CFLAGS) -o $@ $^ -lsocket
+
+zfs_send: zfs_send.c
+ $(CC) $(CFLAGS) -o $@ $^ -lsocket
+
+vmunbundle: vmunbundle.c
+ $(CC) $(CFLAGS) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -o $@ $^
+
node-kstat/build/Release/kstat.node: node-kstat/kstat.cc $(NODE_WAF)
(cd node-kstat && $(NODE_WAF) configure && $(NODE_WAF) build)
@@ -97,8 +110,23 @@ zoneevent: zoneevent.c
vm/tests.tar.gz:
(cd vm && ./tools/build-test-tarball.sh)
+check: $(JSLINT)
+ $(CSTYLE) \
+ qemu-exec.c \
+ vmunbundle.c \
+ zfs_recv.c \
+ zfs_send.c \
+ zoneevent.c
+ @$(JSLINT) --conf=$(ROOT)/tools/jsl.node.conf vm/sbin/*.js
+ @$(JSLINT) --conf=$(ROOT)/tools/jsl.node.conf vm/node_modules/{qmp,VM}.js
+ @$(JSSTYLE) -o indent=4,strict-indent=1,doxygen,unparenthesized-return=0,continuation-at-front=1,leading-right-paren-ok=1 vm/sbin/*.js
+ @$(JSSTYLE) -o indent=4,strict-indent=1,doxygen,unparenthesized-return=0,continuation-at-front=1,leading-right-paren-ok=1 vm/node_modules/{qmp,VM}.js
+
+$(JSLINT):
+ (cd $(ROOT); $(MAKE) jsl)
+
clean:
- @rm -f $(TARGETS) $(SMARTDC_TARGETS)
+ @rm -f $(TARGETS) $(SMARTDC_TARGETS) *.o
(cd node-kstat && $(NODE_WAF) clean)
(cd node-expat && $(NODE_WAF) clean)
(cd node-syslog && $(NODE_WAF) clean)
View
3  src/manifest
@@ -32,6 +32,9 @@ d usr/vm/test 0555 root bin
f usr/vm/sbin/build-user-script 0555 root bin
f usr/vm/sbin/vmadm 0555 root bin
f usr/vm/sbin/vmadmd 0555 root bin
+f usr/vm/sbin/vmunbundle 0555 root bin
+f usr/vm/sbin/zfs_recv 0555 root bin
+f usr/vm/sbin/zfs_send 0555 root bin
f usr/vm/sbin/zoneevent 0555 root bin
f usr/vm/etc/vmadm.completion 0444 root bin
f usr/vm/node_modules/expat_binding.node 0444 root bin
View
14 src/qemu-exec.c
@@ -60,14 +60,15 @@ rotate_logs(void)
char old_filename[] = LOG_FILE_PATTERN;
char new_filename[] = LOG_FILE_PATTERN;
- /* rename:
+ /*
+ * rename:
*
* log.8 -> log.9
* ...
* log.0 -> log.1
*
*/
- for (i=9; i>0; i--) {
+ for (i = 9; i > 0; i--) {
if (snprintf((char *)&old_filename, strlen(LOG_FILE_PATTERN),
LOG_FILE_PATTERN, i - 1) < 0) {
@@ -95,8 +96,6 @@ rotate_logs(void)
if (rename(LOG_FILE, new_filename)) {
perror(LOG_FILE);
}
-
- return;
}
void
@@ -113,8 +112,6 @@ redirect_output(void)
perror("Warning, dup2(stderr) failed");
}
}
-
- return;
}
void
@@ -134,8 +131,6 @@ dump_privs(void)
(void) puts(pname);
}
}
-
- return;
}
void
@@ -147,8 +142,6 @@ dump_args(int argc, char **argv)
for (i = 0; i < argc; i++) {
(void) puts(argv[i]);
}
-
- return;
}
void
@@ -160,5 +153,4 @@ exec_next(int argc, char **argv)
execvp(*argv, argv);
/* if we got here we failed. */
- return;
}
View
48 src/tools/node-lint.json
@@ -1,48 +0,0 @@
-{
- "formatter": {
- "type": "cli",
- "pretty": true,
- "mode": "full",
- "colors": "auto"
- },
-
- //===========Parser============
- "parser": {
- "adsafe": false, // if ADsafe should be enforced
- "bitwise": true, // if bitwise operators should not be allowed
- "browser": false, // if the standard browser globals should be predefined
- "cap": false, // if upper case HTML should be allowed
- "css": false, // if CSS workarounds should be tolerated
- "debug": false, // if debugger statements should be allowed
- "devel": false, // if logging should be allowed (console, alert, etc.)
- "eqeqeq": true, // if === should be required
- "es5": true, // if ES5 syntax should be allowed
- "evil": false, // if eval should be allowed
- "forin": false, // if for in statements must filter
- "fragment": false, // if HTML fragments should be allowed
- "immed": true, // if immediate invocations must be wrapped in parens
- "laxbreak": false, // if line breaks should not be checked
- "newcap": true, // if constructor names must be capitalized
- "nomen": false, // if names should be checked
- "on": false, // if HTML event handlers should be allowed
- "onevar": false, // if only one var statement per function should be allowed
- "passfail": false, // if the scan should stop on first error
- "plusplus": false, // if increment/decrement should not be allowed
- "regexp": true, // if the . should not be allowed in regexp literals
- "rhino": false, // if the Rhino environment globals should be predefined
- "undef": true, // if variables should be declared before used
- "safe": false, // if use of some browser features should be restricted
- "windows": false, // if MS Windows-specific globals should be predefined
- "strict": false, // require the "use strict"; pragma
- "sub": false, // if all forms of subscript notation are tolerated
- "white": true, // if strict whitespace rules apply
- "widget": false, // if the Yahoo Widgets globals should be predefined
- "indent": 4, // set the expected indentation level
- "maxlen": 80, // maximum line length
-
- // the names of predefined global variables: the following are defined by nodejs itself
- "predef": ["exports", "module", "require", "process", "__filename", "__dirname", "global", "console", "setInterval", "setTimeout", "clearInterval", "clearTimeout"],
-
- "nodejs": true
- }
-}
View
9 src/tools/node-lint/.externalToolBuilders/Vows.launch
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
-<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${system_path:vows}"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="--no-color"/>
-<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${build_project}"/>
-</launchConfiguration>
View
27 src/tools/node-lint/.project
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>node-lint</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
- <triggers>auto,full,incremental,</triggers>
- <arguments>
- <dictionary>
- <key>LaunchConfigHandle</key>
- <value>&lt;project&gt;/.externalToolBuilders/Vows.launch</value>
- </dictionary>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
- </natures>
-</projectDescription>
View
6 src/tools/node-lint/.settings/.jsdtscope
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="lib"/>
- <classpathentry kind="src" path="test"/>
- <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
-</classpath>
View
3  src/tools/node-lint/.settings/org.eclipse.core.resources.prefs
@@ -1,3 +0,0 @@
-#Thu Oct 28 22:44:02 CEST 2010
-eclipse.preferences.version=1
-encoding/<project>=UTF-8
View
3  src/tools/node-lint/.settings/org.eclipse.core.runtime.prefs
@@ -1,3 +0,0 @@
-#Thu Oct 28 22:44:02 CEST 2010
-eclipse.preferences.version=1
-line.separator=\n
View
1  src/tools/node-lint/.settings/org.eclipse.wst.jsdt.ui.superType.container
@@ -1 +0,0 @@
-org.eclipse.wst.jsdt.launching.JRE_CONTAINER
View
1  src/tools/node-lint/.settings/org.eclipse.wst.jsdt.ui.superType.name
@@ -1 +0,0 @@
-Global
View
21 src/tools/node-lint/LICENSE
@@ -1,21 +0,0 @@
-The MIT License
-
-Copyright (c) 2010 Julien Polo (author), Alternative Shift© (http://www.alternativeshift.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.
View
57 src/tools/node-lint/Makefile
@@ -1,57 +0,0 @@
-PACKAGE = node-lint
-PACKAGE_BIN = node-lint
-NODEJS = $(if $(shell test -f /usr/bin/nodejs && echo "true"),nodejs,node)
-
-PREFIX ?= /usr/local
-BINDIR ?= $(PREFIX)/bin
-DATADIR ?= $(PREFIX)/share
-MANDIR ?= $(PREFIX)/share/man
-LIBDIR ?= $(PREFIX)/lib
-ETCDIR ?= $(PREFIX)/etc
-PACKAGEDATADIR ?= $(DATADIR)/$(PACKAGE)
-
-BUILDDIR = dist
-
-$(shell if [ ! -d $(BUILDDIR) ]; then mkdir $(BUILDDIR); fi)
-
-DOCS = $(shell find doc -name '*.md' \
- |sed 's|.md|.1|g' \
- |sed 's|doc/|man1/|g' \
- )
-
-all: build doc
-
-build: stamp-build
-
-stamp-build: lib bin etc
- touch $@;
- cp -R -t $(BUILDDIR) $^;
- perl -pi -e 's{^\s*LIB_PATH=.*?\n}{LIB_PATH="$(PACKAGEDATADIR)"\n}ms' $(BUILDDIR)/bin/node-lint
- perl -pi -e 's{^\s*export NODELINT_CONFIG_FILE=.*?\n}{export NODELINT_CONFIG_FILE="$(ETCDIR)/$(PACKAGE).conf"\n}ms' $(BUILDDIR)/bin/$(PACKAGE_BIN)
-
-install: build doc
- install --directory $(PACKAGEDATADIR)
- cp -r -t $(PACKAGEDATADIR) $(BUILDDIR)/lib/*
- install --mode 0644 $(BUILDDIR)/etc/config.json $(ETCDIR)/$(PACKAGE).conf
- install --mode 0755 $(BUILDDIR)/bin/$(PACKAGE_BIN) $(BINDIR)/$(PACKAGE_BIN)
- install --directory $(MANDIR)/man1/
- cp -a man1/node-lint.1 $(MANDIR)/man1/
-
-uninstall:
- rm -rf $(PACKAGEDATADIR) $(ETCDIR)/$(PACKAGE).conf $(BINDIR)/$(PACKAGE_BIN)
- rm -rf $(MANDIR)/man1/$(PACKAGE).1
-
-clean:
- rm -rf $(BUILDDIR) stamp-build
-
-doc: man1 $(DOCS)
- @true
-
-man1:
- @if ! test -d man1 ; then mkdir -p man1 ; fi
-
-# use `npm install ronn` for this to work.
-man1/%.1: doc/%.md
- ronn --roff $< > $@
-
-.PHONY: test install uninstall build all
View
171 src/tools/node-lint/README.md
@@ -1,171 +0,0 @@
-node-lint
---------
-
-- [Node] is a [V8] based framework for writing Javascript applications outside
- the browser.
-
-- [JSLint] is a code quality tool that checks for problems in Javascript programs.
-
-- **node-lint** lets you run JSLint from the command line.
-
-- node-lint currently supports node version 0.2.1
-
-[Node]: http://nodejs.org/
-[V8]: http://code.google.com/p/v8/
-[JSLint]: http://www.jslint.com/lint.html
-
-
-installation
-------------
-
-npm:
-
- $ npm install lint
-
-
-usage
------
-
-You can use `node-lint` directly if you have `node` in your $PATH:
-
- $ ./node-lint path/to/your/file.js
-
-Or if you installed it using npm:
-
- $ node-lint path/to/your/file.js
-
-Otherwise, you need to run it with node:
-
- $ node node-lint path/to/your/file.js
-
-You can also specify a directory param and node-lint will find all .js files under that directory and its subdirectories:
-
- $ node node-lint dir1/ dir2/
-
-Enjoy!
-
-
-config
-------
-
-You can set JSLint options by modifying the default `config.js` file or even
-override the default config by passing another config file with the optional
-`--config` parameter, e.g.
-
- $ node-lint file1 file2 dir1 dir2 --config path/to/your/config/file.json
-
-For example, if the default config.json has:
-
- {
- "adsafe" : false,
- "bitwise" : true,
- "error_prefix" : "\u001b[1m",
- "error_suffix" : ":\u001b[0m "
- }
-
-And your own path/to/your/config/file.json looks like:
-
- {
- "bitwise" : false,
- "browser" : false
- };
-
-Then the final options used will be:
-
- {
- "adsafe" : false,
- "bitwise" : false,
- "browser" : false,
- "error_prefix" : "\u001b[1m",
- "error_suffix" : ":\u001b[0m "
- };
-
-Take a look at [JSLint's Options] to see what to put in the `options` variable.
-
-
-reporters
----------
-
-By default node-lint uses an internal `reporter` function to output it's results
-to the console. For basic use it's possible to alter the `error_prefix` and
-`error_suffix` colors within your `config.js` file. This will prepend or append
-coloring information to the results when JSLint complains about your code. There
-may be times when a more customizable reporting system might be needed (*i.e.
-IDE/Text Editor integrations or customized console outputs*).
-
-node-lint allows you to designate a custom reporter for outputting the results
-from JSLint's run. This `reporter` function will override the default function
-built into node-lint. To utilize a custom reporter first create a js file that
-has a function in it named `reporter`:
-
-`example-reporter.js`:
-
- var sys = require('sys');
-
- function reporter(results) {
- var len = results.length;
- sys.puts(len + ' error' + ((len === 1) ? '' : 's'));
- }
-
-Then when you run node-lint from the command line, pass in the customized
-reporter:
-
-`$ ./node-lint path/to/file.js --reporter path/to/file/example-reporter.js`
-
-For brevity sake, this is a fairly simple reporter. For more elaborate examples
-see the `examples/reporters/` directory or `examples/textmate/`.
-
-The sample XML reporter `examples\reporters\xml.js` produces reports which can
-also be integrated with a Continuous Integration server like [Hudson] using the
-[Violations Plugin].
-
-Please see the [wiki][wiki] for integration with various editors.
-
-[Hudson]: http://hudson-ci.org
-[Violations Plugin]: http://wiki.hudson-ci.org/display/HUDSON/Violations
-
-contribute
-----------
-
-To contribute any patches, simply fork this repository using GitHub and send a
-pull request to me <<http://github.com/tav>>. Thanks!
-
-
-credits
--------
-
-- [tav], wrote node-lint
-
-- [Felix Geisendörfer][felixge], clarified Node.js specific details
-
-- [Douglas Crockford], wrote the original JSLint and rhino.js runner
-
-- [Nathan Landis][my8bird], updated node-lint to Node's new API.
-
-- [Oleg Efimov][Sannis], added support for overridable configurations, running
- node-lint from a symlink and updates to reflect Node.js API changes.
-
-- [Matthew Kitt][mkitt], added support for configurable reporters, various code
- cleanups and improvements including updates to reflect Node.js API changes.
-
-- [Corey Hart], updated node-lint with multiple files and config support.
-
-- [Mamading Ceesay][evangineer], added support for using node-lint within Emacs.
-
-- [Matt Ranney][mranney], updated node-lint to use sys.error.
-
-- [Cliffano Subagio], added npm installation support, XML reporter, and directory param support.
-
-[tav]: http://tav.espians.com
-[felixge]: http://debuggable.com
-[Douglas Crockford]: http://www.crockford.com
-[my8bird]: http://github.com/my8bird
-[Sannis]: http://github.com/Sannis
-[mkitt]: http://github.com/mkitt
-[Corey Hart]: http://www.codenothing.com
-[evangineer]: http://github.com/evangineer
-[mranney]: http://github.com/mranney
-[Cliffano Subagio]: http://blog.cliffano.com
-
-[JSLINT's Options]: http://www.jslint.com/lint.html#options
-[wiki]: http://github.com/tav/node-lint/wiki
View
127 src/tools/node-lint/bin/node-lint
@@ -1,127 +0,0 @@
-#!/usr/bin/env node
-
-/*jslint nodejs:true, indent:4 */
-var util = require(process.binding('natives').util ? 'util' : 'sys'),
- fs = require('fs'),
- path = require('path');
-
-//Build path
-var VERSION = '1.0.0',
- ROOT_PATH = path.dirname(__dirname),
- LIB_PATH = path.join(path.dirname(__dirname), 'lib');
-require.paths.unshift(LIB_PATH);
-
-
-//Include lint library
-var lint = require('lint'),
- Launcher = lint.Launcher;
-
-//called as main executable
-var usage = "Usage: " + process.ARGV[0] + " file.js [dir1 file2 dir2 ...] [options]\n" +
- "Options:\n\n" +
- " --config=FILE the path to a JSON file with JSLINT options\n" +
- " --formatter=FILE optional path to a /dir/dir/file.hs file to customize the output\n" +
- " --no-colors disable colors\n" +
- " --silent disable console output\n" +
- " --pretty enable pretty print for some format (XML, etc)\n" +
- " -h, --help display this help and exit\n" +
- " -v, --version output version information and exit",
- args = process.ARGV.splice(2), arg,
- positionals = [],
- options = {
- formatter: {
- },
- parser: {
- }
- },
- configFile = process.env.NODELINT_CONFIG_FILE || path.join(__dirname, '..', 'etc', 'config.json'),
- launcher = new Launcher();
-
-
-while (args.length !== 0) {
- arg = args.shift();
- switch (arg) {
- case '-v':
- case '--version':
- util.puts(VERSION);
- process.exit(0);
- break;
- case '-h':
- case '--help':
- util.puts(usage);
- process.exit(0);
- break;
- case '--silent':
- options.silent = true;
- break;
- case '--pretty':
- options.formatter.pretty = true;
- break;
- case '--no-color':
- case '--no-colors':
- options.formatter.colors = false;
- break;
- default:
- if (arg.indexOf('--formatter') >= 0) {
- options.formatter.type = 'callback';
- options.formatter.callback = fs.readFileSync(arg.split('=')[1], 'utf8');
- } else if (arg.indexOf('--format') >= 0) {
- options.formatter.type = arg.split('=')[1];
- } else if (arg.indexOf('--mode') >= 0) {
- options.formatter.mode = arg.split('=')[1];
- } else if (arg.indexOf('--config') >= 0) {
- var file, source;
-
- configFile = arg.split('=')[1];
-
- } else {
- positionals.push(arg);
- }
- }
-}
-
-//Load default config file from environment
-if (configFile) {
- var source;
-
- //read config file
- try {
- source = fs.readFileSync(configFile, 'utf8');
- } catch (e) {
- launcher.printError('Read error when accessing "' + configFile + '".');
- }
-
- //Remove comments
- source = source.replace(/\/\*.+?\*\/|\/\/.*(?=[\n\r])/g, '');
-
- //Parse config
- try {
- source = JSON.parse(source);
- } catch (e) {
- console.log(e.toString());
- launcher.printError('Parse Error in "' + configFile + '"');
- }
-
- try {
- launcher.configure(source);
- } catch (e) {
- console.log(e.toString());
- launcher.printError('Parse Error in "' + configFile + '"');
- }
-}
-
-
-
-try {
- launcher.configure(options);
-} catch (e) {
- launcher.printError('Configuration : ' + e.toString());
-}
-
-try {
- launcher.run(positionals);
-} catch (e) {
- launcher.printError('Execution : ' + e.toString());
-}
-
-
View
163 src/tools/node-lint/doc/node-lint.md
@@ -1,163 +0,0 @@
-node-lint(1) -- Run JSLint from the command-line under node.js
-=============================================================
-
-## SYNOPSIS
-
- node-lint [options] <file-or-directory> [<file-or-directory> ...]
-
-## DESCRIPTION
-
-The node-lint command-line tool allows you to check for problems and ensure
-the code quality of your JavaScript files using JSLint.
-
-It is completely extensible so you can use your own custom JSLint config or
-even use custom formatters that better integrate with your quality assurance
-framework.
-
-## OPTIONS
-
- __--formatter FILE__:
- Override the default formatter with your own custom module. See
- the *examples/* directory for custom formatters that come
- bundled with node-lint.
-
- __--config FILE__:
- Override the default *config.js* with your own config file.
-
- __-h__, __--help__:
- Display the help and exit.
-
- __-v__, __--version__:
- Output version information and exit.
-
- __<file-or-directory>__:
- You can run node-lint on specific files or on all *\*.js* files inside
- a directory.
-
-## CONFIG
-
-You can customize the JSLint options by modifying the default config.js
-file or by providing your own config file with the *--config* parameter:
-
- node-lint --config path/to/custom.json file1.js file2.js ...
-
-For example, if the default config.json looks like:
-
- {
- "adsafe" : false,
- "bitwise" : true,
- "error_prefix" : "\u001b[1m",
- "error_suffix" : ":\u001b[0m "
- };
-
-And your custom.json looks like:
-
- {
- "bitwise" : false,
- "browser" : false
- };
-
-Then the final options will be:
-
- {
- "adsafe" : false,
- "bitwise" : false,
- "browser" : false,
- "error_prefix" : "\u001b[1m",
- "error_suffix" : ":\u001b[0m "
- };
-
-## JSLINT OPTIONS
-
- * adsafe:
- True if ADsafe rules should be enforced. See http://www.ADsafe.org/.
- * bitwise:
- True if bitwise operators should not be allowed.
- * browser:
- True if the standard browser globals should be predefined.
- * cap:
- True if upper case HTML should be allowed.
- * css:
- True if CSS workarounds should be tolerated.
- * debug:
- True if debugger statements should be allowed.
- Set this option to false before going into production.
- * devel:
- True if browser globals that are useful in development
- (console, alert, ...) should be predefined.
- * eqeqeq:
- True if === should be required.
- * es5:
- True if ES5 syntax should be allowed.
- * evil:
- True if eval should be allowed.
- * forin:
- True if unfiltered for in statements should be allowed.
- * fragment:
- True if HTML fragments should be allowed.
- * immed:
- True if immediate function invocations must be wrapped in parens
- * indent:
- The number of spaces used for indentation (default is 4)
- * laxbreak:
- True if statement breaks should not be checked.
- * maxerr:
- The maximum number of warnings reported (default is 50)
- * maxlen:
- The maximum number of characters in a line
- * nomen:
- True if names should be checked for initial or trailing underbars
- * newcap:
- True if Initial Caps must be used with constructor functions.
- * on:
- True if HTML event handlers should be allowed.
- * onevar:
- True if only one var statement per function should be allowed.
- * passfail:
- True if the scan should stop on first error.
- * plusplus:
- True if ++ and -- should not be allowed.
- * predef:
- An array of strings (comma separated), the names of predefined global variables.
- predef is used with the option object, but not with the /*jslint */ comment.
- Use the var statement to declare global variables in a script file.
- * regexp:
- True if . and [^...] should not be allowed in RegExp literals.
- These forms should not be used when validating in secure applications.
- * rhino:
- True if the Rhino environment globals should be predefined.
- * safe:
- True if the safe subset rules are enforced. These rules are used by ADsafe.
- It enforces the safe subset rules but not the widget structure rules.
- * strict:
- True if the ES5 "use strict"; pragma is required. Do not use this option carelessly.
- * sub:
- True if subscript notation may be used for expressions better expressed in dot notation.
- * undef:
- True if variables must be declared before used.
- * white:
- True if strict whitespace rules apply.
- * widget:
- True if the Yahoo Widgets globals should be predefined.
- * windows:
- True if the Windows globals should be predefined.
-
-
-## AUTHORS
-
-Originally written by Tav and other node-lint contributors.
-Forked by as-jpolo.
-Contributors list: <http://github.com/tav/nodelint/contributors>.
-
-## REPORTING BUGS
-
-Report node-lint bugs to <http://github.com/as-jpolo/node-lint/issues>.
-
-## COPYRIGHT
-
-node-lint is under MIT License.
-
-## SEE ALSO
-
-node(1)
-
View
50 src/tools/node-lint/etc/config.json
@@ -1,50 +0,0 @@
-//=============================
-// Default Configuration
-//=============================
-{
- //===========Formatter============
- "formatter": {
- "type": "cli", //xml, json, vim, textmate
- "pretty": false,
- "colors": "auto" //'auto', true, false
- },
-
- //===========Parser============
- "parser": {
- //"adsafe": false, // if ADsafe should be enforced
- //"bitwise": true, // if bitwise operators should not be allowed
- //"browser": false, // if the standard browser globals should be predefined
- //"cap": false, // if upper case HTML should be allowed
- //"css": false, // if CSS workarounds should be tolerated
- //"debug": false, // if debugger statements should be allowed
- //"devel": false, // if logging should be allowed (console, alert, etc.)
- //"eqeqeq": true, // if === should be required
- //"es5": true, // if ES5 syntax should be allowed
- //"evil": false, // if eval should be allowed
- //"forin": false, // if for in statements must filter
- //"fragment": false, // if HTML fragments should be allowed
- //"immed": true, // if immediate invocations must be wrapped in parens
- //"laxbreak": false, // if line breaks should not be checked
- //"newcap": true, // if constructor names must be capitalized
- //"nomen": false, // if names should be checked
- //"on": false, // if HTML event handlers should be allowed
- //"onevar": true, // if only one var statement per function should be allowed
- //"passfail": false, // if the scan should stop on first error
- //"plusplus": true, // if increment/decrement should not be allowed
- //"regexp": true, // if the . should not be allowed in regexp literals
- //"rhino": false, // if the Rhino environment globals should be predefined
- //"undef": true, // if variables should be declared before used
- //"safe": false, // if use of some browser features should be restricted
- //"windows": false, // if MS Windows-specific globals should be predefined
- //"strict": false, // require the "use strict"; pragma
- //"sub": false, // if all forms of subscript notation are tolerated
- //"white": true, // if strict whitespace rules apply
- //"widget": false, // if the Yahoo Widgets globals should be predefined
- //"indent": 2, // set the expected indentation level
-
- // the names of predefined global variables: the following are defined by nodejs itself
- //"predef": ["exports", "module", "require", "process", "__filename", "__dirname", "global", "console", "setInterval", "setTimeout", "clearInterval", "clearTimeout"],
-
- //"nodejs": true
- }
-}
View
52 src/tools/node-lint/examples/emacs/flymake-nodelint.el
@@ -1,52 +0,0 @@
-;; On-the-fly syntax checking of javascript using nodelint to run JSLint.
-;;
-;; Changes to this file have been released into the Public Domain.
-;; Adapted from http://www.emacswiki.org/emacs/FlymakeJavaScript
-;;
-;; Installation:
-;;
-;; Put this in your load-path, then add the following to your .emacs.
-;; You substitude espresso-mode-hook for javascript-mode-hook if you
-;; use espresso or js2-mode-hook if using js2-mode.
-;;
-;; (require 'flymake-nodelint)
-;; (add-hook 'javascript-mode-hook
-;; (lambda () (flymake-mode t)))
-;;
-;; Make sure env can find node in your $PATH
-
-(require 'flymake)
-
-(setq flymake-log-level 3)
-
-(defun flymake-nodelint-init ()
- (let* ((temp-file (flymake-init-create-temp-buffer-copy
- 'flymake-create-temp-inplace))
- (local-file (file-relative-name
- temp-file
- (file-name-directory buffer-file-name))))
- (list "nodelint" (list local-file))))
-
-;; needs debugging
-(setq flymake-allowed-file-name-masks
- (cons '(".+\\.js$"
- flymake-nodelint-init
- flymake-simple-cleanup
- flymake-get-real-file-name)
- flymake-allowed-file-name-masks))
-
-;; using this in lieu of the above
-;;(eval-after-load "flymake"
-;; '(progn
-;; (add-to-list 'flymake-allowed-file-name-masks
-;; '("\\.js\\'" flymake-nodelint-init))))
-
-(setq flymake-err-line-patterns
- (cons '("^Lint at line \\([[:digit:]]+\\) character \\([[:digit:]]+\\): \\(.+\\)$"
- nil 1 2 3)
- flymake-err-line-patterns))
-
-(add-hook 'find-file-hook 'flymake-find-file-hook)
-
-(provide 'flymake-nodelint)
-
View
31 src/tools/node-lint/lib/assert/extension.js
@@ -1,31 +0,0 @@
-/*jslint nodejs: true, indent:4 */
-var assert = require('assert');
-var fs = require('fs');
-var lint = require('../lint/parser');
-
-if (! assert.validateLint) {
- assert.validateLint = function (actual, message) {
- var parser, errorCount;
-
- parser = new lint.Parser();
- errorCount = parser.update(actual).getReport().length;
-
- if (errorCount > 0) {
- assert.fail(errorCount, 0, message || "LINT validation returned {actual} error(s)", "===", assert.validateLint);
- }
- };
-}
-
-if (! assert.validateLintFile) {
- assert.validateLintFile = function (actual, message) {
- var parser, errorCount, data;
-
- data = fs.readFileSync(actual);
- parser = new lint.Parser();
- errorCount = parser.update(data).getReport().length;
-
- if (errorCount > 0) {
- assert.fail(errorCount, 0, message || "LINT validation returned {actual} error(s)", "===", assert.validateLintFile);
- }
- };
-}
View
20 src/tools/node-lint/lib/eyes/LICENSE
@@ -1,20 +0,0 @@
-Copyright (c) 2009 cloudhead
-
-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.
View
4 src/tools/node-lint/lib/eyes/Makefile
@@ -1,4 +0,0 @@
-test:
- @@node test/eyes-test.js
-
-.PHONY: test
View
72 src/tools/node-lint/lib/eyes/README.md
@@ -1,72 +0,0 @@
-eyes
-====
-
-a customizable value inspector for Node.js
-
-synopsis
---------
-
-I was tired of looking at cluttered output in the console -- something needed to be done,
-`sys.inspect()` didn't display regexps correctly, and was too verbose, and I had an hour or two to spare.
-So I decided to have some fun. _eyes_ were born.
-
-![eyes-ss](http://dl.dropbox.com/u/251849/eyes-js-ss.gif)
-
-_example of the output of a user-customized eyes.js inspector_
-
-*eyes* also deals with circular objects in an intelligent way, and can pretty-print object literals.
-
-usage
------
-
- var inspect = require('eyes').inspector({styles: {all: 'magenta'}});
-
- inspect(something); // inspect with the settings passed to `inspector`
-
-or
-
- var eyes = require('eyes');
-
- eyes.inspect(something); // inspect with the default settings
-
-you can pass a _label_ to `inspect()`, to keep track of your inspections:
-
- eyes.inspect(something, "a random value");
-
-If you want to return the output of eyes without printing it, you can set it up this way:
-
- var inspect = require('eyes').inspector({ stream: null });
-
- sys.puts(inspect({ something: 42 }));
-
-customization
--------------
-
-These are the default styles and settings used by _eyes_.
- styles: { // Styles applied to stdout
- all: 'cyan', // Overall style applied to everything
- label: 'underline', // Inspection labels, like 'array' in `array: [1, 2, 3]`
- other: 'inverted', // Objects which don't have a literal representation, such as functions
- key: 'bold', // The keys in object literals, like 'a' in `{a: 1}`
-
- special: 'grey', // null, undefined...
- string: 'green',
- number: 'magenta',
- bool: 'blue', // true false
- regexp: 'green', // /\d+/
- },
- pretty: true, // Indent object literals
- hideFunctions: false, // Don't output functions at all
- stream: process.stdout, // Stream to write to, or null
- maxLength: 2048 // Truncate output if longer
-
-You can overwrite them with your own, by passing a similar object to `inspector()` or `inspect()`.
-
- var inspect = require('eyes').inspector({
- styles: {
- all: 'magenta',
- special: 'bold'
- },
- maxLength: 512
- });
-
View
1  src/tools/node-lint/lib/eyes/eyes.js
View
233 src/tools/node-lint/lib/eyes/lib/eyes.js
@@ -1,233 +0,0 @@
-//
-// Eyes.js - a customizable value inspector for Node.js
-//
-// usage:
-//
-// var inspect = require('eyes').inspector({styles: {all: 'magenta'}});
-// inspect(something); // inspect with the settings passed to `inspector`
-//
-// or
-//
-// var eyes = require('eyes');
-// eyes.inspect(something); // inspect with the default settings
-//
-var eyes = exports,
- stack = [];
-
-eyes.defaults = {
- styles: { // Styles applied to stdout
- all: 'cyan', // Overall style applied to everything
- label: 'underline', // Inspection labels, like 'array' in `array: [1, 2, 3]`
- other: 'inverted', // Objects which don't have a literal representation, such as functions
- key: 'bold', // The keys in object literals, like 'a' in `{a: 1}`
- special: 'grey', // null, undefined...
- string: 'green',
- number: 'magenta',
- bool: 'blue', // true false
- regexp: 'green', // /\d+/
- },
- pretty: true, // Indent object literals
- hideFunctions: false,
- stream: process.stdout,
- maxLength: 2048 // Truncate output if longer
-};
-
-// Return a curried inspect() function, with the `options` argument filled in.
-eyes.inspector = function (options) {
- var that = this;
- return function (obj, label, opts) {
- return that.inspect.call(that, obj, label,
- merge(options || {}, opts || {}));
- };
-};
-
-// If we have a `stream` defined, use it to print a styled string,
-// if not, we just return the stringified object.
-eyes.inspect = function (obj, label, options) {
- options = merge(this.defaults, options || {});
-
- if (options.stream) {
- return this.print(stringify(obj, options), label, options);
- } else {
- return stringify(obj, options) + (options.styles ? '\033[39m' : '');
- }
-};
-
-// Output using the 'stream', and an optional label
-// Loop through `str`, and truncate it after `options.maxLength` has been reached.
-// Because escape sequences are, at this point embeded within
-// the output string, we can't measure the length of the string
-// in a useful way, without separating what is an escape sequence,
-// versus a printable character (`c`). So we resort to counting the
-// length manually.
-eyes.print = function (str, label, options) {
- for (var c = 0, i = 0; i < str.length; i++) {
- if (str.charAt(i) === '\033') { i += 4 } // `4` because '\033[25m'.length + 1 == 5
- else if (c === options.maxLength) {
- str = str.slice(0, i - 1) + '';
- break;
- } else { c++ }
- }
- return options.stream.write.call(options.stream, (label ?
- this.stylize(label, options.styles.label, options.styles) + ': ' : '') +
- this.stylize(str, options.styles.all, options.styles) + '\033[0m' + "\n");
-};
-
-// Apply a style to a string, eventually,
-// I'd like this to support passing multiple
-// styles.
-eyes.stylize = function (str, style, styles) {
- var codes = {
- 'bold' : [1, 22],
- 'underline' : [4, 24],
- 'inverse' : [7, 27],
- 'cyan' : [36, 39],
- 'magenta' : [35, 39],
- 'blue' : [34, 39],
- 'yellow' : [33, 39],
- 'green' : [32, 39],
- 'red' : [31, 39],
- 'grey' : [90, 39]
- }, endCode;
-
- if (style && codes[style]) {
- endCode = (codes[style][1] === 39 && styles.all) ? codes[styles.all][0]
- : codes[style][1];
- return '\033[' + codes[style][0] + 'm' + str +
- '\033[' + endCode + 'm';
- } else { return str }
-};
-
-// Convert any object to a string, ready for output.
-// When an 'array' or an 'object' are encountered, they are
-// passed to specialized functions, which can then recursively call
-// stringify().
-function stringify(obj, options) {
- var that = this, stylize = function (str, style) {
- return eyes.stylize(str, options.styles[style], options.styles)
- }, index, result;
-
- if ((index = stack.indexOf(obj)) !== -1) {
- return stylize(new(Array)(stack.length - index + 1).join('.'), 'special');
- }
- stack.push(obj);
-
- result = (function (obj) {
- switch (typeOf(obj)) {
- case "string" : obj = stringifyString(obj.indexOf("'") === -1 ? "'" + obj + "'"
- : '"' + obj + '"');
- return stylize(obj, 'string');
- case "regexp" : return stylize('/' + obj.source + '/', 'regexp');
- case "number" : return stylize(obj + '', 'number');
- case "function" : return options.stream ? stylize("Function", 'other') : '[Function]';
- case "null" : return stylize("null", 'special');
- case "undefined": return stylize("undefined", 'special');
- case "boolean" : return stylize(obj + '', 'bool');
- case "date" : return stylize(obj.toUTCString());
- case "array" : return stringifyArray(obj, options, stack.length);
- case "object" : return stringifyObject(obj, options, stack.length);
- }
- })(obj);
-
- stack.pop();
- return result;
-};
-
-// Escape invisible characters in a string
-function stringifyString (str, options) {
- return str.replace(/\\/g, '\\\\')
- .replace(/\n/g, '\\n')
- .replace(/[\u0001-\u001F]/g, function (match) {
- return '\\0' + match[0].charCodeAt(0).toString(8);
- });
-}
-
-// Convert an array to a string, such as [1, 2, 3].
-// This function calls stringify() for each of the elements
-// in the array.
-function stringifyArray(ary, options, level) {
- var out = [];
- var pretty = options.pretty && (ary.length > 4 || ary.some(function (o) {
- return (typeof(o) === 'object' && Object.keys(o).length > 0) ||
- (Array.isArray(o) && o.length > 0);
- }));
- var ws = pretty ? '\n' + new(Array)(level * 4 + 1).join(' ') : ' ';
-
- for (var i = 0; i < ary.length; i++) {
- out.push(stringify(ary[i], options));
- }
-
- if (out.length === 0) {
- return '[]';
- } else {
- return '[' + ws
- + out.join(',' + (pretty ? ws : ' '))
- + (pretty ? ws.slice(0, -4) : ws) +
- ']';
- }
-};
-
-// Convert an object to a string, such as {a: 1}.
-// This function calls stringify() for each of its values,
-// and does not output functions or prototype values.
-function stringifyObject(obj, options, level) {
- var out = [];
- var pretty = options.pretty && (Object.keys(obj).length > 2 ||
- Object.keys(obj).some(function (k) { return typeof(obj[k]) === 'object' }));
- var ws = pretty ? '\n' + new(Array)(level * 4 + 1).join(' ') : ' ';
-
- Object.keys(obj).forEach(function (k) {
- if (obj.hasOwnProperty(k) && !(obj[k] instanceof Function && options.hideFunctions)) {
- out.push(eyes.stylize(k, options.styles.key, options.styles) + ': ' +
- stringify(obj[k], options));
- }
- });
-
- if (out.length === 0) {
- return '{}';
- } else {
- return "{" + ws
- + out.join(',' + (pretty ? ws : ' '))
- + (pretty ? ws.slice(0, -4) : ws) +
- "}";
- }
-};
-
-// A better `typeof`
-function typeOf(value) {
- var s = typeof(value),
- types = [Object, Array, String, RegExp, Number, Function, Boolean, Date];
-
- if (s === 'object' || s === 'function') {
- if (value) {
- types.forEach(function (t) {
- if (value instanceof t) { s = t.name.toLowerCase() }
- });
- } else { s = 'null' }
- }
- return s;
-}
-
-function merge(/* variable args */) {
- var objs = Array.prototype.slice.call(arguments);
- var target = {};
-
- objs.forEach(function (o) {
- Object.keys(o).forEach(function (k) {
- if (k === 'styles') {
- if (! o.styles) {
- target.styles = false;
- } else {
- target.styles = {}
- for (var s in o.styles) {
- target.styles[s] = o.styles[s];
- }
- }
- } else {
- target[k] = o[k];
- }
- });
- });
- return target;
-}
-
View
14 src/tools/node-lint/lib/eyes/package.json
@@ -1,14 +0,0 @@
-{
- "name" : "eyes",
- "description" : "a customizable value inspector",
- "url" : "http://github.com/cloudhead/eyes.js",
- "keywords" : ["inspector", "debug", "inspect", "print"],
- "author" : "Alexis Sellier <self@cloudhead.net>",
- "contributors" : [],
- "licenses" : ["MIT"],
- "dependencies" : [],
- "main" : "./lib/eyes",
- "version" : "0.1.6",
- "directories" : { "lib": "./lib", "test": "./test" },
- "engines" : { "node": "> 0.1.90" }
-}
View
55 src/tools/node-lint/lib/eyes/test/eyes-test.js
@@ -1,55 +0,0 @@
-var sys = require('sys');
-var eyes = require('../lib/eyes');
-
-eyes.inspect({
- number: 42,
- string: "John Galt",
- regexp: /[a-z]+/,
- array: [99, 168, 'x', {}],
- func: function () {},
- bool: false,
- nil: null,
- undef: undefined,
- object: {attr: []}
-}, "native types");
-
-eyes.inspect({
- number: new(Number)(42),
- string: new(String)("John Galt"),
- regexp: new(RegExp)(/[a-z]+/),
- array: new(Array)(99, 168, 'x', {}),
- bool: new(Boolean)(false),
- object: new(Object)({attr: []}),
- date: new(Date)
-}, "wrapped types");
-
-var obj = {};
-obj.that = { self: obj };
-obj.self = obj;
-
-eyes.inspect(obj, "circular object");
-eyes.inspect({hello: 'moto'}, "small object");
-eyes.inspect({hello: new(Array)(6) }, "big object");
-eyes.inspect(["hello 'world'", 'hello "world"'], "quotes");
-eyes.inspect({
- recommendations: [{
- id: 'a7a6576c2c822c8e2bd81a27e41437d8',
- key: [ 'spree', 3.764316258020699 ],
- value: {
- _id: 'a7a6576c2c822c8e2bd81a27e41437d8',
- _rev: '1-2e2d2f7fd858c4a5984bcf809d22ed98',
- type: 'domain',
- domain: 'spree',
- weight: 3.764316258020699,
- product_id: 30
- }
- }]
-}, 'complex');
-
-
-var inspect = eyes.inspector({ stream: null });
-
-sys.puts(inspect('something', "something"));
-sys.puts(inspect("something else"));
-
-sys.puts(inspect(["no color"], null, { styles: false }));
View
336 src/tools/node-lint/lib/lint/formatter.js
@@ -1,336 +0,0 @@
-/*jslint nodejs: true, indent:4 */
-/**
- * Imports
- */
-
-/*******************************************************************************
- * Report class
- *
- * Usage:
- *
- * <pre>
- * var report = new Report();
- * report.addFile('foo.js', [
- * //... some errors
- * ]);
- * report.addFile('bar.js', [
- * //... some other errors
- * ]);
- * </pre>
- ******************************************************************************/
-/**
- * Report constructor
- *
- * @constructor
- * @return
- */
-function Report() {
- this._files = {};
- this._count = 0;
-}
-
-/**
- * Add file report
- *
- * @param {string} filePath
- * @param {Array} errors
- * @return
- */
-Report.prototype.addFile = function (filePath, errors) {
- errors = errors || [];
-
- this._files[filePath] = {};
- this._files[filePath].file = filePath;
- this._files[filePath].errors = errors;
- this._files[filePath].isValid = errors.length === 0;
-
- this._count += errors.length;
- return this;
-};
-
-/**
- * Return the file report
- *
- * @param {string} file
- * @return {Object}
- */
-Report.prototype.getFile = function (file) {
- return this._files[file];
-};
-
-/**
- *
- * @param {string} file
- * @return {int}
- */
-Report.prototype.countFile = function (file) {
- var fileIterator, count;
-
- count = 0;
- for (fileIterator in this._files) {
- if (this._files.hasOwnProperty(fileIterator)) {
- count += 1;
- }
- }
- return count;
-};
-
-/**
- *
- * @param {string} file
- * @return {int}
- */
-Report.prototype.countErrors = function (file) {
- if (file) {
- return this._files[file].errors.length;
- }
- return this._count;
-};
-
-/**
- * Iterate over the file reports
- *
- * @param {Function} iterator
- * @return this
- */
-Report.prototype.forEach = function (iterator) {
- var file;
-
- for (file in this._files) {
- if (this._files.hasOwnProperty(file)) {
- iterator(this._files[file], file);
- }
- }
- return this;
-};
-
-/*******************************************************************************
- * Formatter class
- *
- * Usage:
- *
- * <pre>
- * var formatter = new Formatter({type: 'json'});
- *
- * formatter.formater( report)//report is instance of Report
- * </pre>
- ******************************************************************************/
-/**
- * Formatter constructor
- *
- * @constructor
- */
-function Formatter(options) {
- this._adapterType = 'cli';
- this._adapter = null;
-
- this.configure(options);
-}
-
-Formatter.SIMPLE = 'simple';
-Formatter.NORMAL = 'normal';
-Formatter.FULL = 'full';
-
-/**
- * Return the adapter from configuration
- *
- * @return {Base}
- */
-Formatter.prototype._getAdapter = function () {
- if (!this._adapter) {
- var formatterModule, FormatterClass, options;
-
- options = {
- type: this._adapterType,
- mode: Formatter.NORMAL
- };
-
- try {
- formatterModule = require('./formatter/' + options.type);
- } catch (e) {
- throw new Error('Formatter "' + options.type + '" not found');
- }
- FormatterClass = formatterModule.Formatter;
-
- if (FormatterClass === undefined) {
- throw new Error('Formatter class not found in module "' + options.type + '"');
- }
-
- this._adapter = new FormatterClass(options);
- }
- return this._adapter;
-};
-
-/**
- * Configure the formatter
- *
- * @return this
- */
-Formatter.prototype.configure = function (options) {
- options = options || {};
- if (options.type !== undefined) {
- this._adapterType = options.type;
- this._adapter = null;
- }
-
- this._getAdapter().configure(options);
- return this;
-};
-
-/**
- * Return a formatted text
- *
- * @return {string}
- */
-Formatter.prototype.format = function (report) {
- return this._getAdapter().format(report);
-};
-
-/*******************************************************************************
- * Base class
- *
- * Usage:
- *
- * > inherits from this class to create a new formatter
- ******************************************************************************/
-/**
- * Base constructor
- *
- * @constructor
- * @param {Object} options
- */
-function Base(options) {
- options = options || {};
-
- this._type = options.type;
- this.mode = Formatter.NORMAL;
- this.encoding = 'utf-8';
- this.tab = "\t";
- this.eol = this._guessEol();
- this.limit = null;
-
- this.configure(options);
-}
-
-/**
- * Configure the formatter
- *
- * @param {Object} options
- * - mode: quantity of information displayed (= simple|normal|full)
- * - encoding: character encoding utf-8
- * - tab: tabulation character used (default: "\t")
- * - eol: end of line character (default: "\n")
- * - limit: limit the error count (default: null)
- *
- * @return this
- */
-Base.prototype.configure = function (options) {
- if (options) {
- if (options.mode !== undefined) {
- if (
- options.mode !== Formatter.SIMPLE &&
- options.mode !== Formatter.NORMAL &&
- options.mode !== Formatter.FULL
- ) {
- throw new Error('mode "' + options.mode + '" is not recognized.');
- }
-
- this.mode = options.mode;
- }
- if (options.encoding !== undefined) {
- this.encoding = options.encoding;
- }
-
- if (options.tab !== undefined) {
- this.tab = options.tab;
- }
- if (options.eol !== undefined) {
- this.eol = options.eol;
- }
-
- if (options.limit !== undefined) {
- this.limit = options.limit;
- }
- }
- return this;
-};
-
-/**
- * Return formatted data
- *
- * @param {Object} data
- * @param {string} mode
- * @return {string}
- */
-Base.prototype.format = function (report, mode) {
- if (report === undefined) {
- throw new Error('`report` should not be undefined');
- }
-
- if (!(report instanceof Report)) {
- throw new Error('`report` should be an instance of Report.');
- }
-
- mode = mode || this.mode;
- report = report || {};
-
- switch (mode) {
- case Formatter.SIMPLE:
- return this._formatSimple(report);
- case Formatter.NORMAL:
- return this._formatNormal(report);
- case Formatter.FULL:
- return this._formatFull(report);
- default:
- throw new Error('type "' + mode + '" does not exist');
- }
-};
-
-/**
- * Return simple formatted content (can be overriden)
- *
- * @return {string}
- */
-Base.prototype._formatSimple = function (report) {
- return this._formatNormal(report);
-};
-
-/**
- * Return normal formatted content (can be overriden)
- *
- * @return {string}
- */
-Base.prototype._formatNormal = function (report) {
- throw new Error('_formatNormal() not implemented.');
-};
-
-/**
- * Return full formatted content (can be overriden)
- *
- * @return {string}
- */
-Base.prototype._formatFull = function (report) {
- return this._formatNormal(report);
-};
-
-Base.prototype._guessEol = function () {
- switch (process.platform) {
- case 'win':
- case 'windows'://TODO: check this if supported
- return "\r\n";
- default:
- return "\n";
- }
-
-};
-
-
-
-
-
-/**
- * Exports
- */
-exports.Formatter = Formatter;
-exports.Base = Base;
-exports.Report = Report;
View
70 src/tools/node-lint/lib/lint/formatter/callback.js
@@ -1,70 +0,0 @@
-/*jslint nodejs: true, indent:4 */
-/**
- * Import
- */
-var util = require(process.binding('natives').util ? 'util' : 'sys');
-var runScript = process.binding('natives').vm ? require('vm').runInNewContext : function (code, sandbox, filename) {
- var scriptObj = new process.binding('evals').Script(code, filename);
-
- return scriptObj.runInNewContext(sandbox);
-};
-var formatter = require('../formatter');
-
-/**
- * Formatter constructor
- *
- * @constructor
- * @extends lint.formatter.Base
- * @param {Object} options
- */
-function Formatter(options) {
- options = options || {};
- this._callback = null;
- this._callbackName = 'format';
-
- formatter.Base.call(this, options);
-}
-util.inherits(Formatter, formatter.Base);
-
-/**
- * Configure the Formatter
- *
- * @param {Object} options
- * @return this
- */
-Formatter.prototype.configure = function (options) {
- if (options) {
- options = options || {};
- Formatter.super_.prototype.configure.call(this, options);
-
- if (options.callback !== undefined) {
- if (typeof(options.callback) === 'string') {
- var scriptObj, env;
-
- env = {};
- runScript(options.callback, env, __filename);
- options.callback = env[this._callbackName];
- }
-
- if (typeof(options.callback) === 'function') {
- this._callback = options.callback;
- } else {
- throw new Error('options.callback must be a Function');
- }
- }
- }
- return this;
-};
-
-/**
- *
- * @return {string}
- */
-Formatter.prototype._formatNormal = function (report) {
- return this._callback(report);
-};
-
-/**
- * Exports
- */
-exports.Formatter = Formatter;
View
365 src/tools/node-lint/lib/lint/formatter/cli.js
@@ -1,365 +0,0 @@
-/*jslint nodejs: true, indent:4 */
-/**
- * Import
- */
-var util = require(process.binding('natives').util ? 'util' : 'sys');
-var formatter = require('../formatter');
-
-/**
- * @link http://en.wikipedia.org/wiki/ANSI_escape_code
- */
-var ESC = String.fromCharCode(27);
-var CONSOLE_STYLES = {
-
- 'font:normal': null,
- 'font:alternate-1': [11, 10],
- 'font:alternate-2': [12, 10],
- 'font:alternate-3': [13, 10],
- 'font:alternate-4': [14, 10],
- 'font:alternate-5': [15, 10],
- 'font:alternate-6': [16, 10],
- 'font:alternate-7': [17, 10],
- 'font:alternate-8': [18, 10],
- 'font:alternate-9': [19, 10],
-
- 'font-weight:normal' : null,
- 'font-weight:bold' : [1, 22],
-
- 'font-style:normal' : null,
- 'font-style:italic' : [3, 23],
-
- 'text-decoration:underline' : [4, 24],
- 'text-decoration:blink' : [5, 25],
- 'text-decoration:reverse' : [7, 27],
- 'text-decoration:invisible' : [8, 28],
-
- 'color:default' : null,
- 'color:black' : [30, 39],
- 'color:blue': [34, 39],
- 'color:blue-hi': [94, 39],
- 'color:cyan' : [36, 39],
- 'color:green' : [32, 39],
- 'color:green-hi' : [92, 39],
- 'color:grey' : [90, 39],
- 'color:magenta' : [35, 39],
- 'color:red' : [31, 39],
- 'color:red-hi' : [95, 39],
- 'color:white' : [37, 39],
- 'color:yellow' : [33, 39],
-
- 'background-color:transparent': null,
- 'background-color:black': [40, 49],
- 'background-color:red': [41, 49],
- 'background-color:green': [42, 49],
- 'background-color:yellow': [43, 49],
- 'background-color:blue': [44, 49],
- 'background-color:magenta': [45, 49],
- 'background-color:cyan': [46, 49],
- 'background-color:white': [47, 49]
-};
-
-var stylize = function (str, style) {
- var styleDefinition, escape;
-
- styleDefinition = CONSOLE_STYLES[style];
-
- if (styleDefinition === undefined) {
- throw new Error('Undefined style "' + style + '"');
- }
-
- if (styleDefinition === null) {
- return str;
- }
-
- return ESC + '[' + styleDefinition[0] + 'm' + str + ESC + '[' + styleDefinition[1] + 'm';
-};
-
-/**
- * Formatter constructor
- *
- * @constructor
- * @extends lint.formatter.Base
- * @param {Object} options
- */
-function Formatter(options) {
- options = options || {};
- formatter.Base.call(this, options);
-
- // customize the error reporting -- the following colours the text red
- this.colors = false;
- this.tab = ' ';
- this.styles = {
- '*': {
- 'background-color' : 'transparent',
- 'font-style' : 'normal',
- 'font-weight' : 'normal',
- 'color' : 'default',
- 'text-decoration' : []
- },
- 'file': {
- 'font': null,
- 'font-weight' : 'bold',
- 'text-decoration' : ['underline']
- },
- 'file-error-count': {
- 'font-weight' : 'bold'
- },
- 'summary-result': {
- 'font-weight' : 'bold'
- },
- 'summary-result-valid': {
- 'color' : 'green'
- },
- 'summary-result-invalid': {
- 'color' : 'red'
- },
- 'summary-file-count': {
- 'font-weight' : 'bold'
- },
- 'summary-error-count': {
- 'font-weight' : 'bold'
- },
-
- 'error-line': {
- 'font-weight' : 'bold'
- },
- 'error-character': {
- 'font-weight' : 'bold'
- },
- 'error-position': {
- 'color' : 'grey'
- },
-
- 'error-evidence': {
- 'font-weight' : 'bold',
- 'color' : 'blue'
- },
- 'error-reason': {
- 'font-style' : 'italic'
- }
- };
- this._styleCache = {};
-
- this.configure(options);
-}
-util.inherits(Formatter, formatter.Base);
-
-/**
- * Configure the Formatter
- *
- * @param {Object} options
- * @return this
- */
-Formatter.prototype.configure = function (options) {
- if (options) {
- var styleClass, styleClassAttributes, styleClassAttribute;
-
- Formatter.super_.prototype.configure.call(this, options);
-
- if (options.colors !== undefined) {
- this.colors = options.colors;
- }
-
- if (options.styles) {
- for (styleClass in options.styles) {
- if (options.style.hasOwnProperty(styleClass)) {
- styleClassAttributes = options.styles[styleClass];
-
- this.styles[styleClass] = this.styles[styleClass] || {};
-
- for (styleClassAttribute in styleClassAttributes) {
- if (styleClassAttributes.hasOwnProperty(styleClassAttribute)) {
- this.styles[styleClass][styleClassAttribute] = styleClassAttributes[styleClassAttribute];
- }
- }
- }
- }
- this._styleCache = {};
- }
- }
- return this;
-};
-
-/**
- *
- * @return {string}
- */
-Formatter.prototype._formatSimple = function (report) {
- var errorCount, fileCount, hasError, output, files;
-
- errorCount = report.countErrors();
- hasError = errorCount === 0;
-
- //Index by files
- fileCount = report.countFile();
-
- output = '';
- output += this._stylize(this._stylize(hasError ? '✓ Valid' : '✗ Invalid', 'summary-result'), hasError ? 'summary-result-valid' : 'summary-result-invalid') + ' » ';
- output += this._stylize(fileCount, 'summary-file-count') + ' file' + ((fileCount <= 1) ? '' : 's');
- output += '';
- output += this._stylize(errorCount, 'summary-error-count') + ' error' + ((errorCount <= 1) ? '' : 's');
-
- return this._line(0, output);
-};
-
-/**
- *
- * @return {string}
- */
-Formatter.prototype._formatNormal = function (report) {
- var thisFormatter, error_regexp, output, errorCount;
-
- thisFormatter = this;
- error_regexp = /^\s*(\S*(\s+\S+)*)\s*$/;
- errorCount = report.countErrors();
-
-
- output = '';
-
- report.forEach(function (fileReport) {
-
- if (!fileReport.isValid) {
- output += thisFormatter._line(0, '' + thisFormatter._stylize(fileReport.file, 'file'));
-
- fileReport.errors.forEach(function (error, errorIndex) {
- output += thisFormatter._line(1,
- thisFormatter._stylize((errorIndex + 1) + ')', 'error-index') + ' ' +
- thisFormatter._stylize((error.evidence || '').replace(error_regexp, "$1"), 'error-evidence') + ' ' +
-
- thisFormatter._stylize(' //' +
- 'line ' + thisFormatter._stylize(error.line, 'error-line'),
- 'error-line')
- );
- output += thisFormatter._line(2, thisFormatter._stylize('» ' + error.reason, 'error-reason'));
- });
-
- output += thisFormatter._line(0);
- }
- });
-
-
- //sum up
- output += this._formatSimple(report);
- return output;
-};
-
-/**
- * @return {string}
- */
-Formatter.prototype._formatFull = function (report) {
- var thisFormatter, error_regexp, output, errorCount;
-
- thisFormatter = this;
- error_regexp = /^\s*(\S*(\s+\S+)*)\s*$/;
- errorCount = report.countErrors();
-
-
- output = '';
- report.forEach(function (fileReport) {
-
- if (!fileReport.isValid) {
- output += thisFormatter._line(0,
- '' + thisFormatter._stylize(fileReport.file, 'file') +
- ' (' + thisFormatter._stylize(fileReport.errors.length, 'file-error-count') + ' errors)'
- );
-
- fileReport.errors.forEach(function (error, errorIndex) {
- output += thisFormatter._line(1,
- thisFormatter._stylize((errorIndex + 1) + ')', 'error-index') + ' ' +
- thisFormatter._stylize((error.evidence || '').replace(error_regexp, "$1"), 'error-evidence') + ' ' +
-
- thisFormatter._stylize(' //' +
- 'line ' + thisFormatter._stylize(error.line, 'error-line') +
- ', ' +
- 'character ' + thisFormatter._stylize(error.character, 'error-character'),
- 'error-line')
- );
- output += thisFormatter._line(2, thisFormatter._stylize('» ' + error.reason, 'error-reason'));
- });
-
- output += thisFormatter._line(0);
- }
- });
-
-