Dinosaur JS, June 24, 2016
// Mootools 1.2
'a bc'.contains('bc'); //returns true
'a b c'.contains('c', ' '); //returns true
'a bc'.contains('b', ' '); //returns false
// ES6
str.contains(searchString[, position])
if (!this.contains(item)) {
this.push(item)
}
Array.forEachMethod(function(method, name){
Elements.implement(name, method);
});
object.forEachMethod = function(fn){
if (!methodsEnumerable) {
for (var i = 0, l = methods.length; i < l; i++){
fn.call(prototype, prototype[methods[i]], methods[i]);
}}
for (var key in prototype) fn.call(prototype, prototype[key], key)
};
Array.implement({
...
contains: function(item, from) {
return this.indexOf(item, from) != -1;
},
The Array prototype object... has a length property whose initial value is 0 and whose attributes are { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: false }.
me.definitions.push('function ' + name + '(' + me.fnArgs + ') {',
' try { with(values) {',
' ' + action,
' }} catch(e) {',
'}',
'}');
When `values` is an Array in that WithStatement, any reference to "values" in the body statement would become `values.values`, referring to Array.prototype.values instead of the original object.
if (is_iphone || android) {
...
window.addEventListener(orientationEvent, function() {
if (window.orientation != 0)
badOrientation();
}}
window.orientation != 0
undefined != 0
badOrientation()
elm.style.webkitTransform
elm.style.WebkitTransform
elm.style['-webkit-transform']
elm.style['transform']
elm.style.webkitTransform
elm.style.WebkitTransform
elm.style['-webkit-transform']
elm.style['transform']
elm.style.webkitTransform
elm.style.WebkitTransform
elm.style['-webkit-transform']
elm.style['transform']
elm.style.webkitTransform'
elm.style.WebkitTransform'
elm.style['-webkit-transform']*
elm.style['transform']
* Possibly soon. see spec bug
CSSStyleDeclaration
interfacepartial interface CSSStyleDeclaration {
[TreatNullAs=EmptyString] attribute DOMString _camel_cased_attribute;
};
partial interface CSSStyleDeclaration {
[TreatNullAs=EmptyString] attribute DOMString _webkit_cased_attribute;
};
body#checkout #slide0 > p {
color: #c5b3cb;
background: -webkit-linear-gradient( 0, rgba(180,180,250,0.7), #fadce5 50%,#fff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}