-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Symbols must be stringified explicitly
Apparently (nodejs/node#927 (comment)), Symbols cannot be implicitly coerced to string. Template stringification leverages implicit coercion, so we must stringify propKey before sending it to the template. Options for explicitly stringifying: - `String(propKey)` - `String.prototype.toString(propKey)` Differences: ``` > String(undefined) 'undefined' > String.prototype.toString(undefined) '' ``` In this case, `propKey` represents the key for the stubbed function. If the key is `undefined`, it would be implicitly coerced to `"undefined"` as the property key. So `String()` is the explicit converstion we want. Four instances of this issue, each where tdFunction is invoked with a dynamic name.
- Loading branch information
1 parent
af487ba
commit 8b2b9c3
Showing
6 changed files
with
43 additions
and
4 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
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