You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Jesse MacFadyen (JIRA)" <ji...@apache.org> on 2013/01/18 00:48:13 UTC

[jira] [Commented] (CB-1583) Some types are not constructable

    [ https://issues.apache.org/jira/browse/CB-1583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13556767#comment-13556767 ] 

Jesse MacFadyen commented on CB-1583:
-------------------------------------

The only remaining place where we are dependent on non-standard object constructors ( not duck typing, and just checking the properties of the object ) are in the compass tests.

{code:javascript}
    describe('Compass Heading model (CompassHeading)', function () {
        it("should exist", function() {
            expect(CompassHeading).toBeDefined();
        });

        it("should be able to create a new CompassHeading instance with no parameters", function() {
            var h = new CompassHeading();
            expect(h.magneticHeading).toBeDefined();
            expect(h.trueHeading).toBeDefined();
            expect(h.headingAccuracy).toBeDefined();
            expect(typeof h.timestamp == 'number').toBe(true);
        });

        it("should be able to create a new CompassHeading instance with parameters", function() {
            var h = new CompassHeading(1,2,3,4);
            expect(h.magneticHeading).toBe(1);
            expect(h.trueHeading).toBe(2);
            expect(h.headingAccuracy).toBe(3);
            expect(h.timestamp.valueOf()).toBe(4);
            expect(typeof h.timestamp == 'number').toBe(true);
        });
    });
{code}

I can remove these tests, but currently there are several compass implementations that depend on having constructor args.

I would like to remove the above 3 tests, and modify the individual compass.js files so that the CompassHeading file is no longer needed.  

I will wait to see if anyone votes this issue up, and leave it as is for now.

                
> Some types are not constructable
> --------------------------------
>
>                 Key: CB-1583
>                 URL: https://issues.apache.org/jira/browse/CB-1583
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: mobile-spec
>    Affects Versions: 2.1.0
>            Reporter: Jesse MacFadyen
>            Assignee: Jesse MacFadyen
>             Fix For: 2.4.0
>
>
> ex. should be able to define a Position object with coords and timestamp properties
> invalid test.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira