-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure the initializer of a destructuring declaration is always inclu…
…ded if the id is included (#4663) * Ensure the initializer of a destructuring declaration is always included if the id is included. * Make watch tests more resilient Ensure that new event listeners are created synchronously after a function handler
- Loading branch information
1 parent
1057ac5
commit 4dd8f96
Showing
4 changed files
with
45 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const assert = require('assert'); | ||
|
||
module.exports = { | ||
description: 'includes for-loop parameters', | ||
exports({ checkObject, checkArray }) { | ||
assert.strictEqual(checkObject({ foo: 1 }), 1, 'object'); | ||
assert.strictEqual(checkArray([2]), 2, 'array'); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export function checkObject(p) { | ||
return getFromObjectInLoop(p); | ||
} | ||
|
||
export function checkArray(p) { | ||
return getFromArrayInLoop(p); | ||
} | ||
|
||
function getFromObjectInLoop(path) { | ||
for (let { foo } = path;;) { | ||
return foo; | ||
} | ||
} | ||
|
||
function getFromArrayInLoop(path) { | ||
for (let [ foo ] = path;;) { | ||
return foo; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters