-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimizing relativeTo() results - closes #95
- Loading branch information
1 parent
38bda29
commit c071df2
Showing
4 changed files
with
47 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1179,16 +1179,31 @@ test("relativeTo", function() { | |
url: 'http://example.org:8081/foo/bar', | ||
base: 'http://example.org/foo/bar', | ||
result: '//example.org:8081/foo/bar' | ||
}, { | ||
name: 'same path - fragment', | ||
url: 'http://www.example.com:8080/dir/file#abcd', | ||
base: 'http://www.example.com:8080/dir/file', | ||
result: '#abcd' | ||
}, { | ||
name: 'same path - query', | ||
url: 'http://www.example.com:8080/dir/file?abcd=123', | ||
base: 'http://www.example.com:8080/dir/file', | ||
result: '?abcd=123' | ||
}, { | ||
name: 'same path - query and fragment', | ||
url: 'http://www.example.com:8080/dir/file?abcd=123#alpha', | ||
base: 'http://www.example.com:8080/dir/file', | ||
result: '?abcd=123#alpha' | ||
}, { | ||
name: 'already relative', | ||
url: 'foo/bar', | ||
base: '/foo/', | ||
throws: true | ||
'throws': true | ||
}, { | ||
name: 'relative base', | ||
url: '/foo/bar', | ||
base: 'foo/', | ||
throws: true | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rodneyrehm
Author
Member
|
||
'throws': true | ||
} | ||
]; | ||
|
||
|
@@ -1204,7 +1219,7 @@ test("relativeTo", function() { | |
caught = true; | ||
} | ||
|
||
if (t.throws) { | ||
if (t['throws']) { | ||
ok(caught, t.name + " should throw exception"); | ||
} else { | ||
ok(!caught, t.name + " should not throw exception"); | ||
|
Well spotted, I always forget that
throws
is a reserved word in EcmaScript 3.(I’m not sure if there’s any browser that actually prevents you using it though...)