mandulaj / Mendeleev.io

The online chemistry engine.
http://mendeleev.io
4 stars 0 forks source link

Problem method stall #16

Open mandulaj opened 10 years ago

mandulaj commented 10 years ago

solve the problem of passing objects around...

arselzer commented 10 years ago

Hi, tried it out again:

/Users/AlexanderSelzer1/git/Mendeleev.io/app/chemistrymath.js:152
Elements.prototype.getElementObject( element ) 
                                     ^
ReferenceError: element is not defined

I think you meant to declare a function:

function getElementObject,

but if changing it this happens:

ReferenceError: test is not defined
      at getElementObject (/Users/AlexanderSelzer1/git/Mendeleev.io/app/chemistrymath.js:154:26)
      at ChemistryMath.parseAtom (/Users/AlexanderSelzer1/git/Mendeleev.io/app/chemistrymath.js:333:17)
      at ChemistryMath.parseMolecule (/Users/AlexanderSelzer1/git/Mendeleev.io/app/chemistrymath.js:300:39)
      at ChemistryMath.parseExpression (/Users/AlexanderSelzer1/git/Mendeleev.io/app/chemistrymath.js:215:39)
      at ChemistryMath.parseEquation (/Users/AlexanderSelzer1/git/Mendeleev.io/app/chemistrymath.js:188:35)
      at Context.<anonymous> (/Users/AlexanderSelzer1/git/Mendeleev.io/app/tests/chemistrymath.js:16:30)

It's caused by this:

      152 function getElementObject( element ) 
      153 {
>>    154     for ( var i = 0; i < test.elements.length; i++ )
      155     {
      156         if ( this.elements[i].symbol == element )
      157         {

It would be nice if we could make it work soon...