Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-6289] Removing old defineProperty shim #804

Merged
merged 3 commits into from
Dec 4, 2011
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 1 addition & 24 deletions mobileweb/src/titanium.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,30 +338,7 @@ function($window, args){
return val + (typeof val == 'number' ? 'px' : '');
};

if(typeof Object.defineProperty == 'undefined'){
// trying to emulate missing defineProperty
try{
Object.defineProperty = function(obj, prop, desc){
if(obj == null || prop == null){
throw "Object.defineProperty: object and property name are required parameters";
}
if(desc == null){
desc = {};
}

if(desc.set){
obj.__defineSetter__(prop, desc.set);
}
if(desc.get && desc.writable !== false){
obj.__defineGetter__(prop, desc.get);
}
};
} catch(e){
console.error(e);
}
}

Ti._5.parseLength = function(val){
Ti._5.parseLength = function(val){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's up with the change in white space? It kinda looks like you're doing a tabs to spaces with a tabstop of 2. Normally we don't do tabs to spaces.

return val + (typeof val == 'number' ? 'px' : '');
};

Expand Down