Skip to content

Commit

Permalink
Merge pull request #28 from sentry-demos/fix-bug-erroring-on-build
Browse files Browse the repository at this point in the history
Reorganize function definition location to prevent error on build
cstavitsky authored Nov 8, 2023
2 parents 7ca52e4 + 16fa72d commit 23f263a
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,57 +1,56 @@
import { Component } from '@angular/core';
import { Component } from "@angular/core";
import * as Sentry from "@sentry/browser";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})

function block(time) {
const start = performance.now();
while (performance.now() - start < time) {}
}

@Component({
selector: "app-root",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.css"],
})
export class AppComponent {
color = 'black';
textValue = '';
currentUser = '';
color = "black";
textValue = "";
currentUser = "";

changeColor() {
var that = this;
this.color = 'red';
this.color = "red";
setTimeout(() => {
that.color = 'black'
that.color = "black";
}, 1500);
}

handleSubmit() {
this.currentUser = this.textValue;
Sentry.configureScope(scope => {
scope.setUser({email: this.currentUser});
Sentry.configureScope((scope) => {
scope.setUser({ email: this.currentUser });
});
}

malformed() {
decodeURIComponent('%');
decodeURIComponent("%");
}

// ERRORS
notAFunctionError() {
var someArray = [{ func: function () {}}];
var someArray = [{ func: function () {} }];
someArray[1].func();
}

uriError() {
decodeURIComponent('%');
decodeURIComponent("%");
}

syntaxError() {
eval('foo bar');
eval("foo bar");
}

rangeError() {
throw new RangeError('Parameter must be between 1 and 100');
throw new RangeError("Parameter must be between 1 and 100");
}

profilingIssue() {

0 comments on commit 23f263a

Please sign in to comment.