-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PR] Add declaration for node.js’ process.emitWarning
Summary: Add declaration and tests for [process.emitWarning](https://nodejs.org/api/process.html#process_process_emitwarning_warning_name_ctor) (introduced in v6.0.0 nodejs/node#4782) Closes #3248 Reviewed By: calebmer Differential Revision: D4861198 fbshipit-source-id: 926a288308301a09656d71f13c7346dff95f9338
- Loading branch information
1 parent
28bec13
commit bfa6a43
Showing
3 changed files
with
269 additions
and
15 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
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,14 @@ | ||
/* @flow */ | ||
|
||
/* emitWarning */ | ||
|
||
process.emitWarning("blah"); | ||
process.emitWarning(new Error("blah")); | ||
process.emitWarning("blah", "blah"); | ||
process.emitWarning("blah", "blah", () => {}); | ||
|
||
process.emitWarning(); // error | ||
process.emitWarning(42); // error | ||
process.emitWarning("blah", 42); // error | ||
process.emitWarning("blah", "blah", 42); // error | ||
(process.emitWarning("blah"): string); // error |