Skip to content

ref: Remove 'use strict' from the bundle #2078

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 2 commits into from
May 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions packages/browser/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const bundleConfig = {
format: 'iife',
name: 'Sentry',
sourcemap: true,
strict: false,
},
context: 'window',
plugins: [
Expand Down
5 changes: 4 additions & 1 deletion packages/browser/src/tracekit.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// tslint:disable

import { getGlobalObject, isError, isErrorEvent } from '@sentry/utils';
import { getGlobalObject, isError, isErrorEvent, normalize } from '@sentry/utils';

/**
* @hidden
Expand Down Expand Up @@ -274,6 +274,9 @@ TraceKit._report = (function reportModuleWrapper() {
var err = (e && (e.detail ? e.detail.reason : e.reason)) || e;
var stack = TraceKit._computeStackTrace(err);
stack.mechanism = 'onunhandledrejection';
if (!stack.message) {
stack.message = JSON.stringify(normalize(err))
}
_notifyHandlers(stack, true, err);
}

Expand Down
12 changes: 6 additions & 6 deletions packages/browser/test/integration/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -667,9 +667,9 @@ for (var idx in frames) {
},
function(sentryData) {
if (debounceAssertEventCount(sentryData, 1, done)) {
// non-error rejections doesnt provide stacktraces so we can skip the assertion
assert.equal(sentryData[0].exception.values[0].value, '"test"');
assert.equal(sentryData[0].exception.values[0].type, 'UnhandledRejection');
assert.equal(sentryData[0].exception.values[0].stacktrace, undefined);
assert.equal(sentryData[0].exception.values[0].mechanism.handled, false);
assert.equal(sentryData[0].exception.values[0].mechanism.type, 'onunhandledrejection');
done();
Expand All @@ -696,9 +696,9 @@ for (var idx in frames) {
},
function(sentryData) {
if (debounceAssertEventCount(sentryData, 1, done)) {
assert.isAtMost(sentryData[0].exception.values[0].value.length, 303);
// non-error rejections doesnt provide stacktraces so we can skip the assertion
assert.equal(sentryData[0].exception.values[0].value.length, 253);
assert.equal(sentryData[0].exception.values[0].type, 'UnhandledRejection');
assert.equal(sentryData[0].exception.values[0].stacktrace, undefined);
assert.equal(sentryData[0].exception.values[0].mechanism.handled, false);
assert.equal(sentryData[0].exception.values[0].mechanism.type, 'onunhandledrejection');
done();
Expand All @@ -725,9 +725,9 @@ for (var idx in frames) {
},
function(sentryData) {
if (debounceAssertEventCount(sentryData, 1, done)) {
// non-error rejections doesnt provide stacktraces so we can skip the assertion
assert.equal(sentryData[0].exception.values[0].value, '{"a":"b"}');
assert.equal(sentryData[0].exception.values[0].type, 'UnhandledRejection');
assert.equal(sentryData[0].exception.values[0].stacktrace, undefined);
assert.equal(sentryData[0].exception.values[0].mechanism.handled, false);
assert.equal(sentryData[0].exception.values[0].mechanism.type, 'onunhandledrejection');
done();
Expand Down Expand Up @@ -761,9 +761,9 @@ for (var idx in frames) {
},
function(sentryData) {
if (debounceAssertEventCount(sentryData, 1, done)) {
assert.isAtMost(sentryData[0].exception.values[0].value.length, 303);
// non-error rejections doesnt provide stacktraces so we can skip the assertion
assert.equal(sentryData[0].exception.values[0].value.length, 253);
assert.equal(sentryData[0].exception.values[0].type, 'UnhandledRejection');
assert.equal(sentryData[0].exception.values[0].stacktrace, undefined);
assert.equal(sentryData[0].exception.values[0].mechanism.handled, false);
assert.equal(sentryData[0].exception.values[0].mechanism.type, 'onunhandledrejection');
done();
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function loadAllIntegrations() {
file: `build/${file.replace('.ts', build.extension)}`,
format: 'cjs',
sourcemap: true,
strict: false,
},
plugins: build.plugins,
})),
Expand Down
2 changes: 2 additions & 0 deletions packages/typescript/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"alwaysStrict": false,
"declaration": true,
"declarationMap": true,
"downlevelIteration": true,
Expand All @@ -12,6 +13,7 @@
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitUseStrict": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
Expand Down