Skip to content

Modularize and extract crashOverlay to iframe #1842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 25, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use CJS imports
  • Loading branch information
Timer committed Apr 21, 2017
commit adb88551863cb80596b9ed3e26b28b08e875fba1
18 changes: 11 additions & 7 deletions packages/react-dev-utils/crashOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@

'use strict';

import { parse } from 'stack-frame-parser';
import { map } from 'stack-frame-mapper';
import { unmap } from 'stack-frame-unmapper';
import codeFrame from 'babel-code-frame';
function _interopDefault(ex) {
return ex && typeof ex === 'object' && 'default' in ex ? ex['default'] : ex;
}

var stackFrameParser = require('stack-frame-parser');
var stackFrameMapper = require('stack-frame-mapper');
var stackFrameUnmapper = require('stack-frame-unmapper');
var codeFrame = _interopDefault(require('babel-code-frame'));
var ansiHTML = require('./ansiHTML');

var boundErrorHandler = null;
Expand Down Expand Up @@ -164,16 +168,16 @@ function consume(error) {
? arguments[2]
: 3;

var parsedFrames = parse(error);
var parsedFrames = stackFrameParser.parse(error);
var enhancedFramesPromise = void 0;
if (error.__unmap_source) {
enhancedFramesPromise = unmap(
enhancedFramesPromise = stackFrameUnmapper.unmap(
error.__unmap_source,
parsedFrames,
contextSize
);
} else {
enhancedFramesPromise = map(parsedFrames, contextSize);
enhancedFramesPromise = stackFrameMapper.map(parsedFrames, contextSize);
}
return enhancedFramesPromise.then(function(enhancedFrames) {
enhancedFrames = enhancedFrames.filter(function(_ref) {
Expand Down