diff options
| author | Elliott Sprehn | 2010-11-03 10:13:03 -0700 | 
|---|---|---|
| committer | Igor Minar | 2010-11-03 11:10:51 -0700 | 
| commit | 690dfe000bf11fa6b39235d9a177dc79948841d4 (patch) | |
| tree | 9a8ef41493e9e7dff0b17ab842ead7d9d3803ed5 /test | |
| parent | 91c835dc0eb5b03e968ad890c41323de80bf45da (diff) | |
| download | angular.js-690dfe000bf11fa6b39235d9a177dc79948841d4.tar.bz2 | |
Serialize RegExp to string in JSON. Closes #119.
Diffstat (limited to 'test')
| -rw-r--r-- | test/JsonSpec.js | 5 | 
1 files changed, 5 insertions, 0 deletions
| diff --git a/test/JsonSpec.js b/test/JsonSpec.js index 17bb97b6..052c239c 100644 --- a/test/JsonSpec.js +++ b/test/JsonSpec.js @@ -30,6 +30,11 @@ describe('json', function(){      assertEquals('[1,"b"]', toJson([1,"b"]));    }); +  it('should parse RegExp', function() { +    assertEquals('"/foo/"', toJson(/foo/)); +    assertEquals('[1,"/foo/"]', toJson([1,new RegExp("foo")])); +  }); +    it('should parse IgnoreFunctions', function() {      assertEquals('[null,1]', toJson([function(){},1]));      assertEquals('{}', toJson({a:function(){}})); | 
