diff options
author | Julien Gilli <julien.gilli@joyent.com> | 2015-02-16 15:34:41 -0800 |
---|---|---|
committer | Julien Gilli <julien.gilli@joyent.com> | 2015-02-16 15:34:41 -0800 |
commit | a6bdd8fd07c71298f6e21026939766ef80dd218e (patch) | |
tree | 338ece4426990df72c561a2486186318c78d729b | |
parent | a35ba2f67dfcdf21b87f4326c6d67150f40224b6 (diff) | |
parent | ad0684807c474db5cda7d28592e34e19910eb7ab (diff) | |
download | node-a6bdd8fd07c71298f6e21026939766ef80dd218e.tar.gz |
Merge remote-tracking branch 'upstream/v0.10' into v0.12
Conflicts:
deps/v8/src/log-utils.cc
-rw-r--r-- | deps/v8/src/log-utils.cc | 9 | ||||
-rw-r--r-- | lib/url.js | 4 | ||||
-rw-r--r-- | test/simple/test-url.js | 8 |
3 files changed, 19 insertions, 2 deletions
diff --git a/deps/v8/src/log-utils.cc b/deps/v8/src/log-utils.cc index c94d07a9f..748d23a0d 100644 --- a/deps/v8/src/log-utils.cc +++ b/deps/v8/src/log-utils.cc @@ -6,6 +6,7 @@ #include "src/log-utils.h" #include "src/string-stream.h" +#include "version.h" namespace v8 { namespace internal { @@ -50,6 +51,14 @@ void Log::Initialize(const char* log_file_name) { OpenFile(log_file_name); } } + + if (output_handle_ != NULL) { + Log::MessageBuilder msg(this); + msg.Append("v8-version,%d,%d,%d,%d,%d\n", Version::GetMajor(), + Version::GetMinor(), Version::GetBuild(), Version::GetPatch(), + Version::IsCandidate()); + msg.WriteToLogFile(); + } } diff --git a/lib/url.js b/lib/url.js index ac712318b..07a6c103a 100644 --- a/lib/url.js +++ b/lib/url.js @@ -639,8 +639,8 @@ Url.prototype.resolveObject = function(relative) { // then it must NOT get a trailing slash. var last = srcPath.slice(-1)[0]; var hasTrailingSlash = ( - (result.host || relative.host) && (last === '.' || last === '..') || - last === ''); + (result.host || relative.host || srcPath.length > 1) && + (last === '.' || last === '..') || last === ''); // strip single dots, resolve double dots to parent dir // if the path tries to go above the root, `up` ends up > 0 diff --git a/test/simple/test-url.js b/test/simple/test-url.js index e81908a88..d0ddaf203 100644 --- a/test/simple/test-url.js +++ b/test/simple/test-url.js @@ -1178,6 +1178,14 @@ var relativeTests = [ ['/foo/bar/baz/', 'quux/baz', '/foo/bar/baz/quux/baz'], ['/foo/bar/baz', '../../../../../../../../quux/baz', '/quux/baz'], ['/foo/bar/baz', '../../../../../../../quux/baz', '/quux/baz'], + ['/foo', '.', '/'], + ['/foo', '..', '/'], + ['/foo/', '.', '/foo/'], + ['/foo/', '..', '/'], + ['/foo/bar', '.', '/foo/'], + ['/foo/bar', '..', '/'], + ['/foo/bar/', '.', '/foo/bar/'], + ['/foo/bar/', '..', '/foo/'], ['foo/bar', '../../../baz', '../../baz'], ['foo/bar/', '../../../baz', '../baz'], ['http://example.com/b//c//d;p?q#blarg', 'https:#hash2', 'https:///#hash2'], |