Merge pull request #5806 from chrootsu/lodash-runInContext

lodash: changed _.runInContext() method
This commit is contained in:
Masahiro Wakame
2015-09-20 18:43:30 +09:00
2 changed files with 21 additions and 8 deletions
+8 -3
View File
@@ -1887,9 +1887,6 @@ result = <void>_<string>([]).noop(true, 'a', 1);
result = <void>_({}).noop(true, 'a', 1);
result = <void>_(any).noop(true, 'a', 1);
var tempObject = {};
result = <typeof _>_.runInContext(tempObject);
// _.property
interface TestPropertyObject {
a: {
@@ -2203,6 +2200,14 @@ result = <number>(_(TestMethodOfObject).methodOf<number>(1, 2).value())(['a', '0
result = _({}).noConflict();
}
// _.runInContext
{
let result: typeof _;
result = _.runInContext();
result = _.runInContext({});
result = _({}).runInContext();
}
// _.uniqueId
result = <string>_.uniqueId();
result = <string>_.uniqueId('');
+13 -5
View File
@@ -8568,11 +8568,19 @@ declare module _ {
//_.runInContext
interface LoDashStatic {
/**
* Create a new lodash function using the given context object.
* @param context The context object
* @returns The lodash function.
**/
runInContext(context: any): typeof _;
* Create a new pristine lodash function using the given context object.
*
* @param context The context object.
* @return Returns a new lodash function.
*/
runInContext(context?: Object): typeof _;
}
interface LoDashObjectWrapper<T> {
/**
* @see _.runInContext
*/
runInContext(): typeof _;
}
//_.times