Bug 739760 - doubles and floats can't be used in dictionaries. r=khuey

This commit is contained in:
Doug Turner 2012-03-29 00:05:44 -07:00
Родитель cc9da83ba5
Коммит b47e1fac99
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -335,6 +335,12 @@ def write_getter(a, iface, fd):
fd.write(" aDict.%s = b;\n" % a.name)
elif realtype.count("PRInt32"):
fd.write(" NS_ENSURE_STATE(JS_ValueToECMAInt32(aCx, v, &aDict.%s));\n" % a.name)
elif realtype.count("double"):
fd.write(" NS_ENSURE_STATE(JS_ValueToNumber(aCx, v, &aDict.%s));\n" % a.name)
elif realtype.count("float"):
fd.write(" double d;\n")
fd.write(" NS_ENSURE_STATE(JS_ValueToNumber(aCx, v, &d));")
fd.write(" aDict.%s = (float) d;\n" % a.name)
elif realtype.count("PRUint16"):
fd.write(" uint32_t u;\n")
fd.write(" NS_ENSURE_STATE(JS_ValueToECMAUint32(aCx, v, &u));\n")