-
Notifications
You must be signed in to change notification settings - Fork 18
Conversation
535f575
to
9cd2617
Compare
9cd2617
to
79a53b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few comments :)
src/Symbol.ts
Outdated
@@ -24,7 +24,7 @@ if (!has('es6-symbol')) { | |||
}; | |||
|
|||
const defineProperties = Object.defineProperties; | |||
const defineProperty: (o: any, p: string | symbol, attributes: PropertyDescriptor & ThisType<any>) => any = Object.defineProperty; | |||
const defineProperty: (o: any, p: string | symbol, attributes: PropertyDescriptor & ThisType<any>) => any = <any> Object.defineProperty; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as any
?
src/support/has.ts
Outdated
@@ -132,7 +132,9 @@ add('es6-string', () => { | |||
|
|||
add('es6-string-raw', () => { | |||
function getCallSite(callSite: TemplateStringsArray, ...substitutions: any[]) { | |||
return callSite; | |||
const result = [...callSite]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: code style: [ ...callSite ]
src/support/has.ts
Outdated
@@ -132,7 +132,9 @@ add('es6-string', () => { | |||
|
|||
add('es6-string-raw', () => { | |||
function getCallSite(callSite: TemplateStringsArray, ...substitutions: any[]) { | |||
return callSite; | |||
const result = [...callSite]; | |||
(<any> result).raw = callSite.raw; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: as any
@@ -22,8 +22,13 @@ export function getValueDescriptor<T>(value: T, enumerable: boolean = false, wri | |||
* | |||
* @param nativeFunction The source function to be wrapped | |||
*/ | |||
export function wrapNative<T, U, R>(nativeFunction: (...args: U[]) => R): (target: T, ...args: U[]) => R { | |||
return function (target: T, ...args: U[]): R { | |||
export function wrapNative<T, U, R>(nativeFunction: (arg1: U) => R): (target: T, arg1: U) => R; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a change required for the TS2.6 upgrade?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. If the old signature is left as-is, 10 errors occur. As an example, in src/array.ts
the following error occurs:
src/array.ts(125,2): error TS2322: Type '(target: ArrayLike<T>, ...args: number[]) => ArrayLike<T>' is not assignable to type '<T>(target: ArrayLike<T>, offset: number, start: number, end?: number | undefined) => ArrayLike<T>'.
Types of parameters 'args' and 'end' are incompatible.
Type 'number | undefined' is not assignable to type 'number'.
Type 'undefined' is not assignable to type 'number'.
Type: enhancement
The following has been addressed in the PR:
Description:
Relates to dojo/meta#210