Browse Source

Merge remote-tracking branch 'upstream/v0.10' into v0.12

Conflicts:
	deps/v8/src/log-utils.cc
v0.12.2-release
Julien Gilli 10 years ago
parent
commit
a6bdd8fd07
  1. 9
      deps/v8/src/log-utils.cc
  2. 4
      lib/url.js
  3. 8
      test/simple/test-url.js

9
deps/v8/src/log-utils.cc

@ -6,6 +6,7 @@
#include "src/log-utils.h" #include "src/log-utils.h"
#include "src/string-stream.h" #include "src/string-stream.h"
#include "version.h"
namespace v8 { namespace v8 {
namespace internal { namespace internal {
@ -50,6 +51,14 @@ void Log::Initialize(const char* log_file_name) {
OpenFile(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();
}
} }

4
lib/url.js

@ -639,8 +639,8 @@ Url.prototype.resolveObject = function(relative) {
// then it must NOT get a trailing slash. // then it must NOT get a trailing slash.
var last = srcPath.slice(-1)[0]; var last = srcPath.slice(-1)[0];
var hasTrailingSlash = ( var hasTrailingSlash = (
(result.host || relative.host) && (last === '.' || last === '..') || (result.host || relative.host || srcPath.length > 1) &&
last === ''); (last === '.' || last === '..') || last === '');
// strip single dots, resolve double dots to parent dir // strip single dots, resolve double dots to parent dir
// if the path tries to go above the root, `up` ends up > 0 // if the path tries to go above the root, `up` ends up > 0

8
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', '/foo/bar/baz/quux/baz'],
['/foo/bar/baz', '../../../../../../../../quux/baz', '/quux/baz'], ['/foo/bar/baz', '../../../../../../../../quux/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'],
['foo/bar/', '../../../baz', '../baz'], ['foo/bar/', '../../../baz', '../baz'],
['http://example.com/b//c//d;p?q#blarg', 'https:#hash2', 'https:///#hash2'], ['http://example.com/b//c//d;p?q#blarg', 'https:#hash2', 'https:///#hash2'],

Loading…
Cancel
Save