/*!
- Ripple Mobile Environment Emulator v0.9.8 :: Built On Fri Apr 04 2014 14:27:22 GMT+0800 (CST)
+ Ripple Mobile Environment Emulator v0.9.8 :: Built On Thu May 15 2014 14:37:42 GMT+0800 (CST)
Apache License
Version 2.0, January 2004
function _bindObjectsToFrame(frame) {
_srcChangedObserver.observe(frame, {attributes: true, attributeFilter: ["src"]});
- frame.addEventListener("beforeload", _beforeLoad);
+ frame.addEventListener("DOMNodeInserted", _beforeLoad);
+// frame.addEventListener("beforeload", _beforeLoad);
// beforeload event of an iframe will not be triggered unless we detach and
// then attach the iframe to the dom tree
var parentNode = frame.parentNode;
- var nextNode = frame.nextNode;
+ var nextNode = frame.nextSibling;
if (parentNode) {
// Disable iframe added observer to avoid infinite loop of binding objects
if (frame.ownerDocument && frame.ownerDocument._iframeAddedObserver) {
frame.ownerDocument._iframeAddedObserver.disconnect();
}
parentNode.removeChild(frame);
- if (nextNode)
- nextNode.insertBefore(frame);
- else
- parentNode.appendChild(frame);
+ parentNode.insertBefore(frame, nextNode);
if (frame.ownerDocument && frame.ownerDocument._iframeAddedObserver) {
_observeIframeAdded(frame.ownerDocument);
*/
var t = require('ripple/platform/tizen/2.0/typedef'),
+ _MAX_INT_BITS = 53,
+ _MAX_INT = Math.pow(2, _MAX_INT_BITS) - 1,
_self;
_self = function (pattern) {
return (x < 0) ? Math.ceil(x) : Math.floor(x);
}
+ function isBitsOverflowed(bits) {
+ return (bits >= _MAX_INT_BITS);
+ }
+
+ function toJsInt(x, isUnsigned) {
+ var min, max;
+
+ min = isUnsigned ? 0 : -_MAX_INT;
+ max = _MAX_INT;
+
+ if ((x < min) || (x > max))
+ return null;
+
+ return toInteger(x);
+ }
+
function modulo(a, b) {
return (a - Math.floor(a / b) * b);
}
if (isNaN(x) || !isFinite(x))
return null;
+ if (isBitsOverflowed(bits))
+ return toJsInt(x, false);
+
p = Math.pow(2, bits);
x = modulo(toInteger(x), p);
if (isNaN(x) || !isFinite(x))
return null;
+ if (isBitsOverflowed(bits))
+ return toJsInt(x, true);
+
return modulo(toInteger(x), Math.pow(2, bits));
}
*/
var t = require('ripple/platform/ivi/3.0/typedef'),
+ _MAX_INT_BITS = 53,
+ _MAX_INT = Math.pow(2, _MAX_INT_BITS) - 1,
_self;
_self = function (pattern) {
if (obj instanceof window.tizen[pattern._constructor])
return true;
+ if ("_derived" in pattern)
+ return true;
+
return false;
}
return (x < 0) ? Math.ceil(x) : Math.floor(x);
}
+ function isBitsOverflowed(bits) {
+ return (bits >= _MAX_INT_BITS);
+ }
+
+ function toJsInt(x, isUnsigned) {
+ var min, max;
+
+ min = isUnsigned ? 0 : -_MAX_INT;
+ max = _MAX_INT;
+
+ if ((x < min) || (x > max))
+ return null;
+
+ return toInteger(x);
+ }
+
function modulo(a, b) {
return (a - Math.floor(a / b) * b);
}
if (isNaN(x) || !isFinite(x))
return null;
+ if (isBitsOverflowed(bits))
+ return toJsInt(x, false);
+
p = Math.pow(2, bits);
x = modulo(toInteger(x), p);
if (isNaN(x) || !isFinite(x))
return null;
+ if (isBitsOverflowed(bits))
+ return toJsInt(x, true);
+
return modulo(toInteger(x), Math.pow(2, bits));
}
break;
}
if (ret === null) {
+ if ("_constructor" in pattern)
+ break;
+
return null;
}
break;
elementType = _self(pattern[0]);
for (i in obj) {
- if (obj[i]) {
+ if (obj[i] !== undefined) {
arr[i] = elementType.copy(obj[i]);
if (arr[i] === null)
return null;
break;
}
if (derived === null) {
+ if ("_constructor" in pattern)
+ break;
+
return null;
}
for (attr in derived) {