chore: run clang-format on code base.

This fixes several minor indentation issues (instanceof precendence,
type declaration specificity, template string length calculation).

This should also fix some flip-flop situations with template strings.
This commit is contained in:
Martin Probst 2015-07-10 11:29:41 +02:00
parent 45994a53ce
commit 3bf8c18c56
26 changed files with 128 additions and 138 deletions

View File

@ -122,8 +122,8 @@ export class PreGeneratedChangeDetection extends ChangeDetection {
_dynamicChangeDetection: ChangeDetection; _dynamicChangeDetection: ChangeDetection;
_protoChangeDetectorFactories: StringMap<string, Function>; _protoChangeDetectorFactories: StringMap<string, Function>;
constructor(@Inject(PROTO_CHANGE_DETECTOR_KEY) @Optional() constructor(@Inject(PROTO_CHANGE_DETECTOR_KEY) @Optional() protoChangeDetectorsForTest?:
protoChangeDetectorsForTest?: StringMap<string, Function>) { StringMap<string, Function>) {
super(); super();
this._dynamicChangeDetection = new DynamicChangeDetection(); this._dynamicChangeDetection = new DynamicChangeDetection();
this._protoChangeDetectorFactories = isPresent(protoChangeDetectorsForTest) ? this._protoChangeDetectorFactories = isPresent(protoChangeDetectorsForTest) ?

View File

@ -108,8 +108,7 @@ class _ConvertAstIntoProtoRecords implements AstVisitor {
visitAccessMember(ast: AccessMember): number { visitAccessMember(ast: AccessMember): number {
var receiver = ast.receiver.visit(this); var receiver = ast.receiver.visit(this);
if (isPresent(this._variableNames) && ListWrapper.contains(this._variableNames, ast.name) && if (isPresent(this._variableNames) && ListWrapper.contains(this._variableNames, ast.name) &&
ast.receiver instanceof ast.receiver instanceof ImplicitReceiver) {
ImplicitReceiver) {
return this._addRecord(RecordType.LOCAL, ast.name, ast.name, [], null, receiver); return this._addRecord(RecordType.LOCAL, ast.name, ast.name, [], null, receiver);
} else { } else {
return this._addRecord(RecordType.PROPERTY, ast.name, ast.getter, [], null, receiver); return this._addRecord(RecordType.PROPERTY, ast.name, ast.getter, [], null, receiver);

View File

@ -245,8 +245,8 @@ export class DirectiveBinding extends ResolvedBinding {
[]; [];
var metadata = DirectiveMetadata.create({ var metadata = DirectiveMetadata.create({
id: stringify(rb.key.token), id: stringify(rb.key.token),
type: ann instanceof type: ann instanceof Component ? DirectiveMetadata.COMPONENT_TYPE :
Component ? DirectiveMetadata.COMPONENT_TYPE : DirectiveMetadata.DIRECTIVE_TYPE, DirectiveMetadata.DIRECTIVE_TYPE,
selector: ann.selector, selector: ann.selector,
compileChildren: ann.compileChildren, compileChildren: ann.compileChildren,
events: ann.events, events: ann.events,
@ -260,8 +260,7 @@ export class DirectiveBinding extends ResolvedBinding {
callOnInit: hasLifecycleHook(onInit, rb.key.token, ann), callOnInit: hasLifecycleHook(onInit, rb.key.token, ann),
callOnAllChangesDone: hasLifecycleHook(onAllChangesDone, rb.key.token, ann), callOnAllChangesDone: hasLifecycleHook(onAllChangesDone, rb.key.token, ann),
changeDetection: ann instanceof changeDetection: ann instanceof Component ? ann.changeDetection : null,
Component ? ann.changeDetection : null,
exportAs: ann.exportAs exportAs: ann.exportAs
}); });
@ -452,10 +451,8 @@ export class ElementInjector extends TreeNode<ElementInjector> implements Depend
// we couple ourselves to the injector strategy to avoid polymoprhic calls // we couple ourselves to the injector strategy to avoid polymoprhic calls
var injectorStrategy = <any>this._injector.internalStrategy; var injectorStrategy = <any>this._injector.internalStrategy;
this._strategy = injectorStrategy instanceof InjectorInlineStrategy ? this._strategy = injectorStrategy instanceof InjectorInlineStrategy ?
new ElementInjectorInlineStrategy( new ElementInjectorInlineStrategy(injectorStrategy, this) :
injectorStrategy, this) : new ElementInjectorDynamicStrategy(injectorStrategy, this);
new ElementInjectorDynamicStrategy(
injectorStrategy, this);
this.hydrated = false; this.hydrated = false;

View File

@ -39,9 +39,9 @@ class BindingRecordsCreator {
return bindings; return bindings;
} }
getDirectiveRecords( getDirectiveRecords(elementBinders: List<renderApi.ElementBinder>,
elementBinders: List<renderApi.ElementBinder>, allDirectiveMetadatas:
allDirectiveMetadatas: List<renderApi.DirectiveMetadata>): List<DirectiveRecord> { List<renderApi.DirectiveMetadata>): List<DirectiveRecord> {
var directiveRecords = []; var directiveRecords = [];
for (var elementIndex = 0; elementIndex < elementBinders.length; ++elementIndex) { for (var elementIndex = 0; elementIndex < elementBinders.length; ++elementIndex) {
@ -277,8 +277,8 @@ function _createVariableBindings(renderProtoView): Map<string, string> {
return variableBindings; return variableBindings;
} }
function _collectNestedProtoViewsVariableNames( function _collectNestedProtoViewsVariableNames(nestedPvsWithIndex: List<RenderProtoViewWithIndex>):
nestedPvsWithIndex: List<RenderProtoViewWithIndex>): List<List<string>> { List<List<string>> {
var nestedPvVariableNames = ListWrapper.createFixedSize(nestedPvsWithIndex.length); var nestedPvVariableNames = ListWrapper.createFixedSize(nestedPvsWithIndex.length);
ListWrapper.forEach(nestedPvsWithIndex, (pvWithIndex) => { ListWrapper.forEach(nestedPvsWithIndex, (pvWithIndex) => {
var parentVariableNames = var parentVariableNames =
@ -301,8 +301,8 @@ function _createVariableNames(parentVariableNames: List<string>, renderProtoView
return res; return res;
} }
export function createVariableLocations( export function createVariableLocations(elementBinders: List<renderApi.ElementBinder>):
elementBinders: List<renderApi.ElementBinder>): Map<string, number> { Map<string, number> {
var variableLocations = new Map(); var variableLocations = new Map();
for (var i = 0; i < elementBinders.length; i++) { for (var i = 0; i < elementBinders.length; i++) {
var binder = elementBinders[i]; var binder = elementBinders[i];
@ -374,8 +374,8 @@ function _createProtoElementInjector(binderIndex, parentPeiWithDistance, renderE
} }
function _createElementBinder(protoView: AppProtoView, boundElementIndex, renderElementBinder, function _createElementBinder(protoView: AppProtoView, boundElementIndex, renderElementBinder,
protoElementInjector, componentDirectiveBinding, protoElementInjector, componentDirectiveBinding, directiveBindings):
directiveBindings): ElementBinder { ElementBinder {
var parent = null; var parent = null;
if (renderElementBinder.parentIndex !== -1) { if (renderElementBinder.parentIndex !== -1) {
parent = protoView.elementBinders[renderElementBinder.parentIndex]; parent = protoView.elementBinders[renderElementBinder.parentIndex];
@ -393,9 +393,9 @@ function _createElementBinder(protoView: AppProtoView, boundElementIndex, render
return elBinder; return elBinder;
} }
export function createDirectiveVariableBindings( export function createDirectiveVariableBindings(renderElementBinder: renderApi.ElementBinder,
renderElementBinder: renderApi.ElementBinder, directiveBindings: List<DirectiveBinding>):
directiveBindings: List<DirectiveBinding>): Map<string, number> { Map<string, number> {
var directiveVariableBindings = new Map(); var directiveVariableBindings = new Map();
MapWrapper.forEach(renderElementBinder.variableBindings, (templateName, exportAs) => { MapWrapper.forEach(renderElementBinder.variableBindings, (templateName, exportAs) => {
var dirIndex = _findDirectiveIndexByExportAs(renderElementBinder, directiveBindings, exportAs); var dirIndex = _findDirectiveIndexByExportAs(renderElementBinder, directiveBindings, exportAs);

View File

@ -177,13 +177,10 @@ export class Binding {
*/ */
dependencies: List<any>; dependencies: List<any>;
constructor(token, {toClass, toValue, toAlias, toFactory, deps}: { constructor(
toClass?: Type, token,
toValue?: any, {toClass, toValue, toAlias, toFactory, deps}:
toAlias?: any, {toClass?: Type, toValue?: any, toAlias?: any, toFactory?: Function, deps?: List<any>}) {
toFactory?: Function,
deps?: List<any>
}) {
this.token = token; this.token = token;
this.toClass = toClass; this.toClass = toClass;
this.toValue = toValue; this.toValue = toValue;
@ -374,8 +371,8 @@ export class BindingBuilder {
} }
} }
function _constructDependencies(factoryFunction: Function, function _constructDependencies(factoryFunction: Function, dependencies: List<any>):
dependencies: List<any>): List<Dependency> { List<Dependency> {
if (isBlank(dependencies)) { if (isBlank(dependencies)) {
return _dependenciesFor(factoryFunction); return _dependenciesFor(factoryFunction);
} else { } else {
@ -393,8 +390,8 @@ function _dependenciesFor(typeOrFunc): List<Dependency> {
return ListWrapper.map(params, (p: List<any>) => _extractToken(typeOrFunc, p, params)); return ListWrapper.map(params, (p: List<any>) => _extractToken(typeOrFunc, p, params));
} }
function _extractToken(typeOrFunc, annotations /*List<any> | any*/, function _extractToken(typeOrFunc, annotations /*List<any> | any*/, params: List<List<any>>):
params: List<List<any>>): Dependency { Dependency {
var depProps = []; var depProps = [];
var token = null; var token = null;
var optional = false; var optional = false;

View File

@ -135,8 +135,7 @@ export class InstantiationError extends AbstractBindingError {
super(key, function(keys: List<any>) { super(key, function(keys: List<any>) {
var first = stringify(ListWrapper.first(keys).token); var first = stringify(ListWrapper.first(keys).token);
return `Error during instantiation of ${first}!${constructResolvingPath(keys)}.` + return `Error during instantiation of ${first}!${constructResolvingPath(keys)}.` +
` ORIGINAL ERROR: ${originalException}` + ` ORIGINAL ERROR: ${originalException}` + `\n\n ORIGINAL STACK: ${originalStack}`;
`\n\n ORIGINAL STACK: ${originalStack}`;
}, originalException, originalStack); }, originalException, originalStack);
this.causeKey = key; this.causeKey = key;

View File

@ -786,8 +786,8 @@ function _resolveBindings(bindings: List<Type | Binding | List<any>>): List<Reso
return resolvedList; return resolvedList;
} }
function _createListOfBindings( function _createListOfBindings(flattenedBindings: Map<number, ResolvedBinding>):
flattenedBindings: Map<number, ResolvedBinding>): List<ResolvedBinding> { List<ResolvedBinding> {
return MapWrapper.values(flattenedBindings); return MapWrapper.values(flattenedBindings);
} }

View File

@ -10,9 +10,8 @@ export var StringMap = global.Object;
var createMapFromPairs: {(pairs: List<any>): Map<any, any>} = (function() { var createMapFromPairs: {(pairs: List<any>): Map<any, any>} = (function() {
try { try {
if (new Map([1, 2]).size === 2) { if (new Map([1, 2]).size === 2) {
return function createMapFromPairs(pairs: List<any>): Map<any, any> { return function createMapFromPairs(pairs: List<any>):
return new Map(pairs); Map<any, any> { return new Map(pairs); };
};
} }
} catch (e) { } catch (e) {
} }

View File

@ -107,9 +107,9 @@ export class FormBuilder {
} }
_createControl(controlConfig: any): modelModule.AbstractControl { _createControl(controlConfig: any): modelModule.AbstractControl {
if (controlConfig instanceof modelModule.Control || controlConfig instanceof if (controlConfig instanceof modelModule.Control ||
modelModule.ControlGroup || controlConfig instanceof controlConfig instanceof modelModule.ControlGroup ||
modelModule.ControlArray) { controlConfig instanceof modelModule.ControlArray) {
return controlConfig; return controlConfig;
} else if (isArray(controlConfig)) { } else if (isArray(controlConfig)) {

View File

@ -98,8 +98,8 @@ export class AbstractControl {
} }
} }
updateValueAndValidity({onlySelf, emitEvent}: {onlySelf?: boolean, updateValueAndValidity({onlySelf, emitEvent}: {onlySelf?: boolean, emitEvent?: boolean} = {}):
emitEvent?: boolean} = {}): void { void {
onlySelf = isPresent(onlySelf) ? onlySelf : false; onlySelf = isPresent(onlySelf) ? onlySelf : false;
emitEvent = isPresent(emitEvent) ? emitEvent : true; emitEvent = isPresent(emitEvent) ? emitEvent : true;
@ -151,8 +151,8 @@ export class Control extends AbstractControl {
this._valueChanges = new EventEmitter(); this._valueChanges = new EventEmitter();
} }
updateValue(value: any, updateValue(value: any, {onlySelf, emitEvent}: {onlySelf?: boolean, emitEvent?: boolean} = {}):
{onlySelf, emitEvent}: {onlySelf?: boolean, emitEvent?: boolean} = {}): void { void {
this._value = value; this._value = value;
if (isPresent(this._onChange)) this._onChange(this._value); if (isPresent(this._onChange)) this._onChange(this._value);
this.updateValueAndValidity({onlySelf: onlySelf, emitEvent: emitEvent}); this.updateValueAndValidity({onlySelf: onlySelf, emitEvent: emitEvent});

View File

@ -188,8 +188,8 @@ export class DomRenderer extends Renderer {
view.setElementProperty(location.boundElementIndex, propertyName, propertyValue); view.setElementProperty(location.boundElementIndex, propertyName, propertyValue);
} }
setElementAttribute(location: RenderElementRef, attributeName: string, setElementAttribute(location: RenderElementRef, attributeName: string, attributeValue: string):
attributeValue: string): void { void {
var view = resolveInternalDomView(location.renderView); var view = resolveInternalDomView(location.renderView);
view.setElementAttribute(location.boundElementIndex, attributeName, attributeValue); view.setElementAttribute(location.boundElementIndex, attributeName, attributeValue);
} }

View File

@ -89,8 +89,8 @@ export class KeyEventsPlugin extends EventManagerPlugin {
return fullKey; return fullKey;
} }
static eventCallback(element, shouldSupportBubble, fullKey, handler, static eventCallback(element, shouldSupportBubble, fullKey, handler, zone):
zone): (event: Event) => void { (event: Event) => void {
return (event) => { return (event) => {
var correctElement = shouldSupportBubble || event.target === element; var correctElement = shouldSupportBubble || event.target === element;
if (correctElement && StringWrapper.equals(KeyEventsPlugin.getEventFullKey(event), fullKey)) { if (correctElement && StringWrapper.equals(KeyEventsPlugin.getEventFullKey(event), fullKey)) {

View File

@ -343,10 +343,10 @@ const ATTRIBUTE_PREFIX = 'attr';
const CLASS_PREFIX = 'class'; const CLASS_PREFIX = 'class';
const STYLE_PREFIX = 'style'; const STYLE_PREFIX = 'style';
function buildElementPropertyBindings( function buildElementPropertyBindings(protoElement: /*element*/ any, isNgComponent: boolean,
protoElement: /*element*/ any, isNgComponent: boolean,
bindingsInTemplate: Map<string, ASTWithSource>, bindingsInTemplate: Map<string, ASTWithSource>,
directiveTempaltePropertyNames: Set<string>): List<api.ElementPropertyBinding> { directiveTempaltePropertyNames: Set<string>):
List<api.ElementPropertyBinding> {
var propertyBindings = []; var propertyBindings = [];
MapWrapper.forEach(bindingsInTemplate, (ast, propertyNameInTemplate) => { MapWrapper.forEach(bindingsInTemplate, (ast, propertyNameInTemplate) => {
var propertyBinding = createElementPropertyBinding(ast, propertyNameInTemplate); var propertyBinding = createElementPropertyBinding(ast, propertyNameInTemplate);
@ -376,8 +376,8 @@ function isValidElementPropertyBinding(protoElement: /*element*/ any, isNgCompon
return true; return true;
} }
function createElementPropertyBinding(ast: ASTWithSource, function createElementPropertyBinding(ast: ASTWithSource, propertyNameInTemplate: string):
propertyNameInTemplate: string): api.ElementPropertyBinding { api.ElementPropertyBinding {
var parts = StringWrapper.split(propertyNameInTemplate, PROPERTY_PARTS_SEPARATOR); var parts = StringWrapper.split(propertyNameInTemplate, PROPERTY_PARTS_SEPARATOR);
if (parts.length === 1) { if (parts.length === 1) {
var propName = parts[0]; var propName = parts[0];

View File

@ -118,7 +118,8 @@ function _clearInterval(id: number) {
} }
function _fnAndFlush(fn: Function): Function { function _fnAndFlush(fn: Function): Function {
return (... args) => { fn.apply(global, args); return (...args) => {
fn.apply(global, args);
flushMicrotasks(); flushMicrotasks();
} }
} }

View File

@ -242,9 +242,8 @@ export function makeDecorator(annotationCls, chainFn: (fn: Function) => void = n
if (this instanceof annotationCls) { if (this instanceof annotationCls) {
return annotationInstance; return annotationInstance;
} else { } else {
var chainAnnotation = isFunction(this) && this.annotations instanceof Array ? var chainAnnotation =
this.annotations : isFunction(this) && this.annotations instanceof Array ? this.annotations : [];
[];
chainAnnotation.push(annotationInstance); chainAnnotation.push(annotationInstance);
var TypeDecorator: TypeDecorator = <TypeDecorator>function TypeDecorator(cls) { var TypeDecorator: TypeDecorator = <TypeDecorator>function TypeDecorator(cls) {
var annotations = Reflect.getMetadata('annotations', cls); var annotations = Reflect.getMetadata('annotations', cls);

View File

@ -213,11 +213,13 @@ class _DirectiveUpdating {
* Map from test id to _DirectiveUpdating. * Map from test id to _DirectiveUpdating.
* Definitions in this map define definitions which allow testing directive updating. * Definitions in this map define definitions which allow testing directive updating.
*/ */
static availableDefinitions: StringMap<string, _DirectiveUpdating> = { static availableDefinitions:
StringMap<string, _DirectiveUpdating> = {
'directNoDispatcher': new _DirectiveUpdating( 'directNoDispatcher': new _DirectiveUpdating(
[_DirectiveUpdating.updateA('42', _DirectiveUpdating.basicRecords[0])], [_DirectiveUpdating.updateA('42', _DirectiveUpdating.basicRecords[0])],
[_DirectiveUpdating.basicRecords[0]]), [_DirectiveUpdating.basicRecords[0]]),
'groupChanges': new _DirectiveUpdating( 'groupChanges':
new _DirectiveUpdating(
[ [
_DirectiveUpdating.updateA('1', _DirectiveUpdating.basicRecords[0]), _DirectiveUpdating.updateA('1', _DirectiveUpdating.basicRecords[0]),
_DirectiveUpdating.updateB('2', _DirectiveUpdating.basicRecords[0]), _DirectiveUpdating.updateB('2', _DirectiveUpdating.basicRecords[0]),
@ -240,8 +242,9 @@ class _DirectiveUpdating {
'readingDirectives': 'readingDirectives':
new _DirectiveUpdating( new _DirectiveUpdating(
[ [
BindingRecord.createForHostProperty( BindingRecord.createForHostProperty(new DirectiveIndex(0, 0),
new DirectiveIndex(0, 0), _getParser().parseBinding('a', 'location'), PROP_NAME) _getParser().parseBinding('a', 'location'),
PROP_NAME)
], ],
[_DirectiveUpdating.basicRecords[0]]), [_DirectiveUpdating.basicRecords[0]]),
'interpolation': 'interpolation':

View File

@ -6,10 +6,9 @@ import {RecordType, ProtoRecord} from 'angular2/src/change_detection/proto_recor
import {DirectiveIndex} from 'angular2/src/change_detection/directive_record'; import {DirectiveIndex} from 'angular2/src/change_detection/directive_record';
export function main() { export function main() {
function r( function r(funcOrValue, args, contextIndex, selfIndex,
funcOrValue, args, contextIndex, selfIndex, {lastInBinding, mode, name, directiveIndex}:
{lastInBinding, mode, name, {lastInBinding?: any, mode?: any, name?: any, directiveIndex?: any} = {}) {
directiveIndex}: {lastInBinding?: any, mode?: any, name?: any, directiveIndex?: any} = {}) {
if (isBlank(lastInBinding)) lastInBinding = false; if (isBlank(lastInBinding)) lastInBinding = false;
if (isBlank(mode)) mode = RecordType.PROPERTY; if (isBlank(mode)) mode = RecordType.PROPERTY;
if (isBlank(name)) name = "name"; if (isBlank(name)) name = "name";

View File

@ -158,8 +158,7 @@ export class Unparser implements AstVisitor {
visitMethodCall(ast: MethodCall) { visitMethodCall(ast: MethodCall) {
this._visit(ast.receiver); this._visit(ast.receiver);
this._expression += ast.receiver instanceof ImplicitReceiver ? `${ast.name}(` : this._expression += ast.receiver instanceof ImplicitReceiver ? `${ast.name}(` : `.${ast.name}(`;
`.${ast.name}(`;
var isFirst = true; var isFirst = true;
ast.args.forEach(arg => { ast.args.forEach(arg => {
if (!isFirst) this._expression += ', '; if (!isFirst) this._expression += ', ';

View File

@ -58,8 +58,8 @@ export function main() {
rootProtoView = createRootProtoView(directiveResolver, MainComponent); rootProtoView = createRootProtoView(directiveResolver, MainComponent);
}); });
function createCompiler( function createCompiler(renderCompileResults:
renderCompileResults: List<renderApi.ProtoViewDto | Promise<renderApi.ProtoViewDto>>, List<renderApi.ProtoViewDto | Promise<renderApi.ProtoViewDto>>,
protoViewFactoryResults: List<List<AppProtoView>>) { protoViewFactoryResults: List<List<AppProtoView>>) {
var urlResolver = new UrlResolver(); var urlResolver = new UrlResolver();
renderCompileRequests = []; renderCompileRequests = [];
@ -510,8 +510,8 @@ function createViewportElementBinder(nestedProtoView): ElementBinder {
return elBinder; return elBinder;
} }
function createRenderProtoView(elementBinders = null, function createRenderProtoView(elementBinders = null, type: renderApi.ViewType = null):
type: renderApi.ViewType = null): renderApi.ProtoViewDto { renderApi.ProtoViewDto {
if (isBlank(type)) { if (isBlank(type)) {
type = renderApi.ViewType.COMPONENT; type = renderApi.ViewType.COMPONENT;
} }

View File

@ -67,8 +67,8 @@ export class DomTestbed {
DOM.appendChild(DOM.querySelector(document, 'body'), this.rootEl); DOM.appendChild(DOM.querySelector(document, 'body'), this.rootEl);
} }
compileAll(directivesOrViewDefinitions: List<DirectiveMetadata | compileAll(directivesOrViewDefinitions:
ViewDefinition>): Promise<List<ProtoViewDto>> { List<DirectiveMetadata | ViewDefinition>): Promise<List<ProtoViewDto>> {
return PromiseWrapper.all(ListWrapper.map(directivesOrViewDefinitions, (entry) => { return PromiseWrapper.all(ListWrapper.map(directivesOrViewDefinitions, (entry) => {
if (entry instanceof DirectiveMetadata) { if (entry instanceof DirectiveMetadata) {
return this.compiler.compileHost(entry); return this.compiler.compileHost(entry);

View File

@ -69,10 +69,8 @@ export class PerfLogFeatures {
gc: boolean; gc: boolean;
frameCapture: boolean; frameCapture: boolean;
constructor({render = false, gc = false, constructor({render = false, gc = false, frameCapture = false}:
frameCapture = false}: {render?: boolean, {render?: boolean, gc?: boolean, frameCapture?: boolean} = {}) {
gc?: boolean,
frameCapture?: boolean} = {}) {
this.render = render; this.render = render;
this.gc = gc; this.gc = gc;
this.frameCapture = frameCapture; this.frameCapture = frameCapture;

View File

@ -141,8 +141,8 @@ export class ChromeDriverExtension extends WebDriverExtension {
} }
} }
function normalizeEvent(chromeEvent: StringMap<string, any>, function normalizeEvent(chromeEvent: StringMap<string, any>, data: StringMap<string, any>):
data: StringMap<string, any>): StringMap<string, any> { StringMap<string, any> {
var ph = chromeEvent['ph']; var ph = chromeEvent['ph'];
if (StringWrapper.equals(ph, 'S')) { if (StringWrapper.equals(ph, 'S')) {
ph = 'b'; ph = 'b';

View File

@ -81,8 +81,8 @@ export function main() {
createExtension() createExtension()
.timeEnd('name1', 'name2') .timeEnd('name1', 'name2')
.then((_) => { .then((_) => {
expect(log).toEqual( expect(log)
[['executeScript', `console.timeEnd('name1');console.time('name2');`]]); .toEqual([['executeScript', `console.timeEnd('name1');console.time('name2');`]]);
async.done(); async.done();
}); });
})); }));

View File

@ -71,8 +71,8 @@ export function main() {
createExtension() createExtension()
.timeEnd('name1', 'name2') .timeEnd('name1', 'name2')
.then((_) => { .then((_) => {
expect(log).toEqual( expect(log)
[['executeScript', `console.timeEnd('name1');console.time('name2');`]]); .toEqual([['executeScript', `console.timeEnd('name1');console.time('name2');`]]);
async.done(); async.done();
}); });
})); }));