Skip to content

Commit 092335c

Browse files
authored
Replace goog/asserts with simple exception (#625)
1 parent b8d260a commit 092335c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

closure/compiler/test/goog_es6_interop/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ closure_js_library(
3636
suppress = ["moduleLoad"],
3737
deps = [
3838
":person",
39-
"@com_google_javascript_closure_library//closure/goog/asserts",
4039
],
4140
)
4241

closure/compiler/test/goog_es6_interop/person_factory.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
goog.declareModuleId('rulesClosure.googEs6Interop.personFactory');
2121

2222
import {Person} from '/closure/compiler/test/goog_es6_interop/person.js';
23-
import {assert} from 'goog:goog.asserts';
2423

2524
/**
2625
* Creates a new `Person`.
@@ -30,6 +29,9 @@ import {assert} from 'goog:goog.asserts';
3029
*/
3130
export const createPerson = (name) => {
3231
const pieces = name.split(' ');
32+
if (pieces.length != 2) {
33+
throw new Error('Assertion failed');
34+
}
3335
assert(2 === pieces.length);
3436
return new Person(pieces[0], pieces[1]);
3537
};

0 commit comments

Comments
 (0)