This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree 2 files changed +1
-23
lines changed
2 files changed +1
-23
lines changed Original file line number Diff line number Diff line change @@ -50,14 +50,6 @@ bp.resetIterations = function() {
50
50
bp . runState . iterations = 0 ;
51
51
} ;
52
52
53
- bp . interpolateHtml = function ( string , list ) {
54
- list . forEach ( function ( item , i ) {
55
- var exp = new RegExp ( '%' + i , [ 'g' ] ) ;
56
- string = string . replace ( exp , item ) ;
57
- } ) ;
58
- return string ;
59
- }
60
-
61
53
bp . numMilliseconds = function ( ) {
62
54
if ( window . performance != null && typeof window . performance . now == 'function' ) {
63
55
return window . performance . now ( ) ;
@@ -310,7 +302,7 @@ bp.addLinks = function() {
310
302
// Add new benchmark suites here
311
303
[ 'tree.html' , 'TreeComponent' ]
312
304
] . forEach ( ( function ( link ) {
313
- linkHtml += bp . interpolateHtml ( '<a href=%0>%1 </a>' , link ) ;
305
+ linkHtml += '<a href="' + link [ 0 ] + '">' + link [ 1 ] + ' </a>';
314
306
} ) ) ;
315
307
316
308
linkDiv . innerHTML = linkHtml ;
Original file line number Diff line number Diff line change @@ -262,20 +262,6 @@ describe('bp', function() {
262
262
} ) ;
263
263
264
264
265
- describe ( '.interpolateHtml' , function ( ) {
266
- it ( 'should render a list of values into a string' , function ( ) {
267
- expect ( bp . interpolateHtml ( '<div>%0</div><a>%1</a>' , [ 'Hello' , 'Jeff' ] ) ) .
268
- toBe ( '<div>Hello</div><a>Jeff</a>' ) ;
269
- } ) ;
270
-
271
-
272
- it ( 'should replace multiple instances of a token' , function ( ) {
273
- expect ( bp . interpolateHtml ( '<div>%0</div><a>%0</a>' , [ 'Hello' ] ) ) .
274
- toBe ( '<div>Hello</div><a>Hello</a>' ) ;
275
- } ) ;
276
- } ) ;
277
-
278
-
279
265
describe ( '.setIterations()' , function ( ) {
280
266
it ( 'should set provided arguments to runState object' , function ( ) {
281
267
bp . runState = { numSamples : 20 } ;
You can’t perform that action at this time.
0 commit comments