Skip to content

Commit 1e2864f

Browse files
committed
Use unicode escape sequence to avoid it being encoded wrong
1 parent 021c8bc commit 1e2864f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/raven.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ function objectMerge(obj1, obj2) {
561561
}
562562

563563
function truncate(str, max) {
564-
return str.length <= max ? str : str.substr(0, max) + '';
564+
return str.length <= max ? str : str.substr(0, max) + '\u2026';
565565
}
566566

567567
function getHttpData() {

test/raven.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ describe('globals', function() {
202202

203203
describe('truncate', function() {
204204
it('should work as advertised', function() {
205-
assert.equal(truncate('lolol', 3), 'lol');
205+
assert.equal(truncate('lolol', 3), 'lol\u2026');
206206
assert.equal(truncate('lolol', 10), 'lolol');
207207
assert.equal(truncate('lol', 3), 'lol');
208208
});

0 commit comments

Comments
 (0)