File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
- export class SimpleMap {
1
+ export const createSimpleMap = ( ) => class SimpleMap {
2
2
constructor ( ) {
3
3
this . size = 0 ;
4
4
this . keys = [ ] ;
@@ -18,8 +18,8 @@ export class SimpleMap {
18
18
19
19
return value ;
20
20
}
21
- }
21
+ } ;
22
22
23
- const exportedMap = typeof Map === 'undefined' ? SimpleMap : Map ;
23
+ const exportedMap = typeof Map === 'undefined' ? createSimpleMap ( ) : Map ;
24
24
25
25
export default exportedMap ;
Original file line number Diff line number Diff line change 1
1
import {
2
2
expect
3
3
} from 'chai' ;
4
- import { SimpleMap } from './../src/simple-map' ;
4
+ import { createSimpleMap } from './../src/simple-map' ;
5
5
6
6
const getTests = ( map ) => {
7
7
return ( ) => {
@@ -28,6 +28,8 @@ const getTests = (map) => {
28
28
} ;
29
29
30
30
describe ( 'SimpleMap' , ( ) => {
31
+ const SimpleMap = createSimpleMap ( ) ;
32
+
31
33
context ( 'simple map with primitive or object as keys' , getTests ( new SimpleMap ( ) ) ) ;
32
34
if ( typeof Map !== 'undefined' ) {
33
35
context ( 'sanity - running tests against native Map' , getTests ( new Map ( ) ) ) ;
You can’t perform that action at this time.
0 commit comments