Permalink
Browse files

Merge branch 'v0.6'

  • Loading branch information...
2 parents 5ad0140 + 3733a85 commit 31ad1d29c7e2a2d7ea140799b180c53cfa53863c @piscisaureus piscisaureus committed Mar 8, 2012
Showing with 112 additions and 9 deletions.
  1. +6 −1 LICENSE
  2. +3 −2 deps/uv/include/uv.h
  3. +2 −0 deps/uv/src/unix/error.c
  4. +3 −0 deps/uv/src/win/error.c
  5. +1 −2 doc/api/fs.markdown
  6. +17 −4 src/node_file.cc
  7. +18 −0 tools/doc/LICENSE
  8. +20 −0 tools/doc/generate.js
  9. +21 −0 tools/doc/html.js
  10. +21 −0 tools/doc/json.js
View
@@ -79,8 +79,13 @@ The externally maintained libraries used by Node are:
licensed under a permissive free software license. See
deps/zlib/LICENSE.
- - deps/npm npm is a package manager program copyright 2009, 2010, 2011
+ - deps/npm npm is a package manager program copyright 2009 - 2012
Isaac Z. Schlueter and licensed under MIT. npm includes several
subpackages MIT or Apache licenses, see deps/npm/LICENSE for more
information. npm is included in the Node .msi and .pkg distributions
but not in the Node binary itself.
+
+ - tools/doc/node_modules/marked Marked is a Markdown parser Copyright
+ (c) 2011-2012, Christopher Jeffrey (https://github.com/chjj/). Marked
+ is used in the generation of node documentation, but not distributed in
+ any node binaries.
View
@@ -80,7 +80,7 @@ typedef intptr_t ssize_t;
XX( 7, EAFNOSUPPORT, "") \
XX( 8, EALREADY, "") \
XX( 9, EBADF, "bad file descriptor") \
- XX( 10, EBUSY, "mount device busy") \
+ XX( 10, EBUSY, "resource busy or locked") \
XX( 11, ECONNABORTED, "software caused connection abort") \
XX( 12, ECONNREFUSED, "connection refused") \
XX( 13, ECONNRESET, "connection reset by peer") \
@@ -120,7 +120,8 @@ typedef intptr_t ssize_t;
XX( 49, ENAMETOOLONG, "name too long") \
XX( 50, EPERM, "operation not permitted") \
XX( 51, ELOOP, "too many symbolic links encountered") \
- XX( 52, EXDEV, "cross-device link not permitted")
+ XX( 52, EXDEV, "cross-device link not permitted") \
+ XX( 53, ENOTEMPTY, "directory not empty")
#define UV_ERRNO_GEN(val, name, s) UV_##name = val,
View
@@ -88,6 +88,8 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case ESRCH: return UV_ESRCH;
case ETIMEDOUT: return UV_ETIMEDOUT;
case EXDEV: return UV_EXDEV;
+ case EBUSY: return UV_EBUSY;
+ case ENOTEMPTY: return UV_ENOTEMPTY;
default: return UV_UNKNOWN;
}
UNREACHABLE();
View
@@ -78,6 +78,8 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case WSAEAFNOSUPPORT: return UV_EAFNOSUPPORT;
case WSAEWOULDBLOCK: return UV_EAGAIN;
case WSAEALREADY: return UV_EALREADY;
+ case ERROR_LOCK_VIOLATION: return UV_EBUSY;
+ case ERROR_SHARING_VIOLATION: return UV_EBUSY;
case ERROR_CONNECTION_ABORTED: return UV_ECONNABORTED;
case WSAECONNABORTED: return UV_ECONNABORTED;
case ERROR_CONNECTION_REFUSED: return UV_ECONNREFUSED;
@@ -102,6 +104,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case ERROR_OUTOFMEMORY: return UV_ENOMEM;
case ERROR_NOT_CONNECTED: return UV_ENOTCONN;
case WSAENOTCONN: return UV_ENOTCONN;
+ case ERROR_DIR_NOT_EMPTY: return UV_ENOTEMPTY;
case ERROR_NOT_SUPPORTED: return UV_ENOTSUP;
case ERROR_INSUFFICIENT_BUFFER: return UV_EINVAL;
case ERROR_INVALID_FLAGS: return UV_EBADF;
View
@@ -498,8 +498,7 @@ reliable.
<!--type=misc-->
-When watching a directory,
-providing `filename` argument in the callback is not supported
+Providing `filename` argument in the callback is not supported
on every platform (currently it's only supported on Linux and Windows). Even
on supported platforms `filename` is not always guaranteed to be provided.
Therefore, don't assume that `filename` argument is always provided in the
View
@@ -51,7 +51,18 @@ using namespace v8;
#define THROW_BAD_ARGS TYPE_ERROR("Bad argument")
-typedef class ReqWrap<uv_fs_t> FSReqWrap;
+class FSReqWrap: public ReqWrap<uv_fs_t> {
+ public:
+ FSReqWrap(const char* syscall)
+ : syscall_(syscall) {
+ }
+
+ const char* syscall() { return syscall_; }
+
+ private:
+ const char* syscall_;
+};
+
static Persistent<String> encoding_symbol;
static Persistent<String> errno_symbol;
@@ -88,11 +99,13 @@ static void After(uv_fs_t *req) {
// If the request doesn't have a path parameter set.
if (!req->path) {
- argv[0] = UVException(req->errorno);
- } else {
argv[0] = UVException(req->errorno,
NULL,
+ req_wrap->syscall());
+ } else {
+ argv[0] = UVException(req->errorno,
NULL,
+ req_wrap->syscall(),
static_cast<const char*>(req->path));
}
} else {
@@ -208,7 +221,7 @@ struct fs_req_wrap {
#define ASYNC_CALL(func, callback, ...) \
- FSReqWrap* req_wrap = new FSReqWrap(); \
+ FSReqWrap* req_wrap = new FSReqWrap(#func); \
int r = uv_fs_##func(uv_default_loop(), &req_wrap->req_, \
__VA_ARGS__, After); \
req_wrap->object_->Set(oncomplete_sym, callback); \
View
@@ -0,0 +1,18 @@
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+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
@@ -1,4 +1,24 @@
#!node
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
var marked = require('marked');
var fs = require('fs');
View
@@ -1,3 +1,24 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
var fs = require('fs');
var marked = require('marked');
var path = require('path');
View
@@ -1,3 +1,24 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
module.exports = doJSON;
// Take the lexed input, and return a JSON-encoded object

0 comments on commit 31ad1d2

Please sign in to comment.