Rename JS<T> to Dom<T>

This commit is contained in:
Anthony Ramine 2017-09-25 23:56:32 +02:00
parent 0e3c54c191
commit 7be32fb237
96 changed files with 494 additions and 494 deletions

View file

@ -574,10 +574,10 @@ def check_rust(file_name, lines):
# No benefit over using &str
(r": &String", "use &str instead of &String", no_filter),
# There should be any use of banned types:
# Cell<JSVal>, Cell<JS<T>>, DOMRefCell<JS<T>>, DOMRefCell<HEAP<T>>
# Cell<JSVal>, Cell<Dom<T>>, DOMRefCell<Dom<T>>, DOMRefCell<HEAP<T>>
(r"(\s|:)+Cell<JSVal>", "Banned type Cell<JSVal> detected. Use MutJS<JSVal> instead", no_filter),
(r"(\s|:)+Cell<JS<.+>>", "Banned type Cell<JS<T>> detected. Use MutJS<T> instead", no_filter),
(r"DOMRefCell<JS<.+>>", "Banned type DOMRefCell<JS<T>> detected. Use MutJS<T> instead", no_filter),
(r"(\s|:)+Cell<Dom<.+>>", "Banned type Cell<Dom<T>> detected. Use MutJS<T> instead", no_filter),
(r"DOMRefCell<Dom<.+>>", "Banned type DOMRefCell<Dom<T>> detected. Use MutJS<T> instead", no_filter),
(r"DOMRefCell<Heap<.+>>", "Banned type DOMRefCell<Heap<T>> detected. Use MutJS<T> instead", no_filter),
# No benefit to using &Root<T>
(r": &Root<", "use &T instead of &Root<T>", no_filter),

View file

@ -7,13 +7,13 @@
extern crate script;
use script::test::Dom;
use script::test::DOMRefCell;
use script::test::JS;
use script::test::Node;
struct Foo {
bar: DOMRefCell<JS<Node>>
//~^ ERROR Banned type DOMRefCell<JS<T>> detected. Use MutJS<T> instead
bar: DOMRefCell<Dom<Node>>
//~^ ERROR Banned type DOMRefCell<Dom<T>> detected. Use MutJS<T> instead
}
fn main() {}

View file

@ -151,7 +151,7 @@ class CheckTidiness(unittest.TestCase):
self.assertNoMoreErrors(ban_errors)
ban_errors = tidy.collect_errors_for_files(iterFile('ban-domrefcell.rs'), [], [tidy.check_rust], print_text=False)
self.assertEqual('Banned type DOMRefCell<JS<T>> detected. Use MutJS<T> instead', ban_errors.next()[2])
self.assertEqual('Banned type DOMRefCell<Dom<T>> detected. Use MutJS<T> instead', ban_errors.next()[2])
self.assertNoMoreErrors(ban_errors)
def test_spec_link(self):