Merge branch 'master' into shared_cache
This commit is contained in:
+1
-1
@@ -134,7 +134,7 @@ export namespace css {
|
||||
*/
|
||||
export function toColor(css: string): IColor {
|
||||
// Formats: #rgb[a] and #rrggbb[aa]
|
||||
if (css.match(/#[0-9a-f]{3,8}/i)) {
|
||||
if (css.match(/#[\da-f]{3,8}/i)) {
|
||||
switch (css.length) {
|
||||
case 4: { // #rgb
|
||||
$r = parseInt(css.slice(1, 2).repeat(2), 16);
|
||||
|
||||
@@ -29,7 +29,9 @@ export class ServiceCollection {
|
||||
}
|
||||
|
||||
public forEach(callback: (id: IServiceIdentifier<any>, instance: any) => any): void {
|
||||
this._entries.forEach((value, key) => callback(key, value));
|
||||
for (const [key, value] of this._entries.entries()) {
|
||||
callback(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
public has(id: IServiceIdentifier<any>): boolean {
|
||||
|
||||
@@ -59,7 +59,7 @@ describe('OptionsService', () => {
|
||||
});
|
||||
it('normalizes invalid fontWeight option values', () => {
|
||||
service.options.fontWeight = 350;
|
||||
assert.doesNotThrow(() => service.options.fontWeight = 10000), 'fontWeight should be normalized instead of throwing';
|
||||
assert.doesNotThrow(() => service.options.fontWeight = 10000, 'fontWeight should be normalized instead of throwing');
|
||||
assert.equal(service.options.fontWeight, DEFAULT_OPTIONS.fontWeight, 'Values greater than 1000 should be reset to default');
|
||||
|
||||
service.options.fontWeight = 350;
|
||||
|
||||
Reference in New Issue
Block a user