feat: remove MapWrapper.contains().

This commit is contained in:
Martin Probst
2015-06-17 21:42:56 -07:00
parent be7ac9fd41
commit dfd30910aa
18 changed files with 28 additions and 30 deletions

View File

@ -421,7 +421,7 @@ export class ProtoElementInjector {
var visitedIds: Map<number, boolean> = new Map();
ListWrapper.forEach(dirBindings, dirBinding => {
ListWrapper.forEach(dirBinding.resolvedHostInjectables, b => {
if (MapWrapper.contains(visitedIds, b.key.id)) {
if (visitedIds.has(b.key.id)) {
throw new BaseException(
`Multiple directives defined the same host injectable: "${stringify(b.key.token)}"`);
}
@ -730,7 +730,7 @@ export class ElementInjector extends TreeNode<ElementInjector> {
hasVariableBinding(name: string): boolean {
var vb = this._proto.directiveVariableBindings;
return isPresent(vb) && MapWrapper.contains(vb, name);
return isPresent(vb) && vb.has(name);
}
getVariableBinding(name: string): any {
@ -891,7 +891,7 @@ export class ElementInjector extends TreeNode<ElementInjector> {
private _buildAttribute(dep: DirectiveDependency): string {
var attributes = this._proto.attributes;
if (isPresent(attributes) && MapWrapper.contains(attributes, dep.attributeName)) {
if (isPresent(attributes) && attributes.has(dep.attributeName)) {
return attributes.get(dep.attributeName);
} else {
return null;

View File

@ -115,7 +115,7 @@ class BindingRecordsCreator {
directiveMetadata: renderApi.DirectiveMetadata): DirectiveRecord {
var id = boundElementIndex * 100 + directiveIndex;
if (!MapWrapper.contains(this._directiveRecordsMap, id)) {
if (!this._directiveRecordsMap.has(id)) {
this._directiveRecordsMap.set(
id, new DirectiveRecord({
directiveIndex: new DirectiveIndex(boundElementIndex, directiveIndex),

View File

@ -73,7 +73,7 @@ export class AppView implements ChangeDispatcher, EventDispatcher {
setLocal(contextName: string, value): void {
if (!this.hydrated()) throw new BaseException('Cannot set locals on dehydrated view.');
if (!MapWrapper.contains(this.proto.variableBindings, contextName)) {
if (!this.proto.variableBindings.has(contextName)) {
return;
}
var templateName = this.proto.variableBindings.get(contextName);

View File

@ -71,7 +71,7 @@ export class TestabilityRegistry {
if (elem == null) {
return null;
}
if (MapWrapper.contains(this._applications, elem)) {
if (this._applications.has(elem)) {
return this._applications.get(elem);
}
if (DOM.isShadowRoot(elem)) {