Permalink
Browse files

Update hasEm for angular

  • Loading branch information...
1 parent 2bd8cb4 commit 354fdd80c578b5ed44f0a3b15780ea3a9cf4c346 @MiCHiLU committed Mar 26, 2013
Showing with 5 additions and 1 deletion.
  1. +4 −1 angular-unicode_eastasianwidth.coffee
  2. +1 −0 tests/testAngularSpec.coffee
@@ -39,4 +39,7 @@ angular.module("unicode_eastasianwidth", [
])
.factory "hasEm", ->
- unicodeEastAsianWidth.hasEm
+ (text) ->
+ unless text?
+ return false
+ unicodeEastAsianWidth.hasEm(text)
@@ -50,4 +50,5 @@ describe "east-asian-width", ->
it "should return hasEm", inject((hasEm) ->
expect(hasEm("aaああ")).toEqual true
expect(hasEm("aa")).toEqual false
+ expect(hasEm(undefined)).toEqual false
)

0 comments on commit 354fdd8

Please sign in to comment.