Skip to content

Commit

Permalink
Fix dep-check-config
Browse files Browse the repository at this point in the history
  • Loading branch information
rcebulko committed May 13, 2021
1 parent 3d53846 commit 9540be7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build-system/test-configs/dep-check-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ exports.rules = [
'3p/**->src/url.js',
'3p/**->src/config.js',
'3p/**->src/mode.js',
'3p/**->src/json.js',
'3p/**->src/core/types/object/json.js',
'3p/**->src/3p-frame-messaging.js',
'3p/**->src/internal-version.js',
'3p/polyfills.js->src/polyfills/math-sign.js',
Expand Down
11 changes: 4 additions & 7 deletions src/3p-frame-messaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import {dev, devAssert} from './log';
import {dict} from './core/types/object';
import {internalListenImplementation} from './event-helper-listen';
import {parseJson} from './core/types/object/json';
import {tryParseJson} from './core/types/object/json';

/** @const */
const AMP_MESSAGE_PREFIX = 'amp-';
Expand Down Expand Up @@ -120,12 +120,9 @@ export function deserializeMessage(message) {
}
const startPos = message.indexOf('{');
devAssert(startPos != -1, 'JSON missing in %s', message);
try {
return parseJson(message.substr(startPos));
} catch (e) {
dev().error('MESSAGING', 'Failed to parse message: ' + message, e);
return null;
}
return tryParseJson(message.substr(startPos), (e) =>
dev().error('MESSAGING', 'Failed to parse message: ' + message, e)
);
}

/**
Expand Down

0 comments on commit 9540be7

Please sign in to comment.