55 stringify ,
66 assertionsEnabled ,
77 StringJoiner ,
8- RegExpWrapper ,
98 serializeEnum ,
109 CONST_EXPR
1110} from 'angular2/src/facade/lang' ;
@@ -17,7 +16,7 @@ import {HtmlAst, HtmlAttrAst, HtmlTextAst, HtmlElementAst} from './html_ast';
1716import { Injectable } from 'angular2/src/core/di' ;
1817import { HtmlToken , HtmlTokenType , tokenizeHtml } from './html_lexer' ;
1918import { ParseError , ParseLocation , ParseSourceSpan } from './parse_util' ;
20- import { HtmlTagDefinition , getHtmlTagDefinition } from './html_tags' ;
19+ import { HtmlTagDefinition , getHtmlTagDefinition , getHtmlTagNamespacePrefix } from './html_tags' ;
2120
2221export class HtmlTreeError extends ParseError {
2322 static create ( elementName : string , location : ParseLocation , msg : string ) : HtmlTreeError {
@@ -134,7 +133,7 @@ class TreeBuilder {
134133 if ( this . peek . type === HtmlTokenType . TAG_OPEN_END_VOID ) {
135134 this . _advance ( ) ;
136135 selfClosing = true ;
137- if ( namespacePrefix ( fullName ) == null && ! getHtmlTagDefinition ( fullName ) . isVoid ) {
136+ if ( getHtmlTagNamespacePrefix ( fullName ) == null && ! getHtmlTagDefinition ( fullName ) . isVoid ) {
138137 this . errors . push ( HtmlTreeError . create (
139138 fullName , startTagToken . sourceSpan . start ,
140139 `Only void and foreign elements can be self closed "${ startTagToken . parts [ 1 ] } "` ) ) ;
@@ -237,16 +236,9 @@ function getElementFullName(prefix: string, localName: string,
237236 if ( isBlank ( prefix ) ) {
238237 prefix = getHtmlTagDefinition ( localName ) . implicitNamespacePrefix ;
239238 if ( isBlank ( prefix ) && isPresent ( parentElement ) ) {
240- prefix = namespacePrefix ( parentElement . name ) ;
239+ prefix = getHtmlTagNamespacePrefix ( parentElement . name ) ;
241240 }
242241 }
243242
244243 return mergeNsAndName ( prefix , localName ) ;
245244}
246-
247- var NS_PREFIX_RE = / ^ @ ( [ ^ : ] + ) / g;
248-
249- function namespacePrefix ( elementName : string ) : string {
250- var match = RegExpWrapper . firstMatch ( NS_PREFIX_RE , elementName ) ;
251- return isBlank ( match ) ? null : match [ 1 ] ;
252- }
0 commit comments