Skip to content

Commit

Permalink
Fix labels from stack traces in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown committed Aug 16, 2019
1 parent 1ea9b3a commit 47262b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .changeset/gold-onions-sniff/changes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "releases": [{ "name": "@emotion/core", "type": "patch" }], "dependents": [] }
1 change: 1 addition & 0 deletions .changeset/gold-onions-sniff/changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix labels from stack traces in some cases
4 changes: 3 additions & 1 deletion packages/core/src/jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ export const jsx: typeof React.createElement = function(
let error = new Error()
if (error.stack) {
// chrome
let match = error.stack.match(/at jsx.*\n\s+at ([A-Z][A-Za-z$]+) /)
let match = error.stack.match(
/at (?:Object\.|)jsx.*\n\s+at ([A-Z][A-Za-z$]+) /
)
if (!match) {
// safari and firefox
match = error.stack.match(/^.*\n([A-Z][A-Za-z$]+)@/)
Expand Down

0 comments on commit 47262b6

Please sign in to comment.