disnet / contracts.coffee

Contracts for CoffeeScript
http://disnet.github.io/contracts.coffee/
MIT License
216 stars 6 forks source link

illegal access exception when sorting an array #59

Open gregwebs opened 11 years ago

gregwebs commented 11 years ago
insertTags :: (Str, [...Any]) -> Str
insertTags = (str, tags) ->
  tags.sort()
  str

insertTags("foo", [ 
    id: 130410605169
    length: 14
    name: "Chelsea Lately"
    offset: 0
    type: "page"
  ,
    id: 18813753280
    length: 21
    name: "Human Rights Campaign"
    offset: 41
    type: "page"
  ]
)
illegal access angular.js:5563
(anonymous function) angular.js:5563
(anonymous function) angular.js:4661
wrappedCallback angular.js:6625
(anonymous function) angular.js:6660
Scope.$eval angular.js:7808
Scope.$digest angular.js:7680
Scope.$apply angular.js:7894
done angular.js:8883
completeRequest angular.js:9023
(anonymous function) angular.js:8973
doneWrapper angular.js:9035
gregwebs commented 11 years ago

when I remove the contract everything works fine

disnet commented 11 years ago

Running this code works fine for me. Is something else calling it? And can you confirm you're using the lastest version of contracts.coffee? I would suspect this error to happen when we were wrapping arrays in contracts but we turned that off with the latest.

gregwebs commented 11 years ago

I am on latest. Probably has to do with contracts from a caller.