Lowercase DOM getters at compile time, fixes #4728

The implementation was copied directly from
https://github.com/rust-lang/rust/pull/16636
and updated for rust changes, so the credit goes to @Manishearth
This commit is contained in:
Arpad Borsos 2015-02-03 13:49:24 +01:00
parent ff53354ba7
commit 02d750adba
3 changed files with 70 additions and 7 deletions

View file

@ -40,12 +40,15 @@ pub mod reflector;
pub mod lints;
/// Utilities for writing plugins
pub mod utils;
pub mod casing;
#[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) {
reg.register_syntax_extension(intern("dom_struct"), Modifier(box jstraceable::expand_dom_struct));
reg.register_syntax_extension(intern("jstraceable"), Decorator(box jstraceable::expand_jstraceable));
reg.register_syntax_extension(intern("_generate_reflector"), Decorator(box reflector::expand_reflector));
reg.register_macro("to_lower", casing::expand_lower);
reg.register_macro("to_upper", casing::expand_upper);
reg.register_lint_pass(box lints::transmute_type::TransmutePass as LintPassObject);
reg.register_lint_pass(box lints::unrooted_must_root::UnrootedPass as LintPassObject);
reg.register_lint_pass(box lints::privatize::PrivatizePass as LintPassObject);