tnhu / jsface

Small, fast, elegant, powerful, and cross platform JavaScript OOP library. Support main(), singleton, super call, private, mixins, plugins, AOP and more.
MIT License
301 stars 46 forks source link

issue unit tests and mixin native classes #1

Closed luakri closed 12 years ago

luakri commented 12 years ago

hello tahhnhu

first of all my congrats for such a helper in creating something like jsface, a very lightweight oop library,i have already played with your library creating classes, subclasses, extending and augmenting, and using the super call.

will use definitely your library organizing both my client side scripts as well node scripts. so far only played in the client side with your library, cant wait to do the same in node. a oop library to work in both client side and in node, that is great.

when digging more in the examples of the api, i came across this example

extend(Array.prototype, { trim: function() { return this.replace(/^\s+|\s+$/g, ""); } });

" Hello World ".trim(); // "Hello World"

works in ff, chrome, safari, ie9, but does not work in ie8, ie7 and probably ie6 as well

also when debugging, tested the units test page, the page does not display correctly in ie8 and ie7, in the file /test/tests/core.js

there are some extra commas in the end of the object declaration

line 632 and line 598, extra commas

after fixing this , the page of unit tests display correctly, but reports errors in some unit tests in ie7 and ie8

issues:

unit test 5 - each returned value over a string (1, 0, 1) - invalid each returned value over a string -

unit test 11 - Check type with jsface.isMap on iframe (1, 0, 1) - 1 - Died on test #1: Object doesn't support this action - { "message": "Object doesn't support this action", "description": "Object doesn't support this action", "number": -2146827843, "name": "TypeError" }

unit test 13 - Check type with jsface.isArray on iframe (1, 0, 1) - 1 - Died on test #1: Object doesn't support this action - { "message": "Object doesn't support this action", "description": "Object doesn't support this action", "number": -2146827843, "name": "TypeError" }

unit test 15 - Check type with jsface.isFunction on iframe (1, 0, 1) - 1 - Died on test #1: Object doesn't support this action - { "message": "Object doesn't support this action", "description": "Object doesn't support this action", "number": -2146827843, "name": "TypeError" }

once again congrats for your work developing this library, it looks very promissing.

cheers

tnhu commented 12 years ago

Hi luakri,

Many thanks for the detailed report. I'll be spending some time on the issues tonight. Overall, there are some bugs in my unit tests :)

Best,

Tan Nhu

tnhu commented 12 years ago

Fixed.

Tested:

Let me know if you found any things else.

Cheers,

Tan