question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Please suggest solution for older WebKit `Object.defineProperties`

See original GitHub issue

Hi Kovid! I have been loving to work with RapydScript-NG, even delving a little into the internals as required by my project. Jappy is looking nice! I’ve added .zip export, more examples, and done further testing.

However, as you perhaps know, I’m trying to target certain platforms as a webview app. In particular, I’ve had difficulty with both Android Webviews (older Webkit) and Sugar activities (WebKit2).

They tend to fail when redefining properties with Object.defineProperties when they’ve already been defined once.

The following code fails for both of these platforms:

for i in range(10):
    def a(u):
        print ('lala')
    print (i)
    b = document.createElement('button')
    b.onclick = a
    document.body.appendChild(b)

While the android webview is hard to debug, I have a main.py in the Jappy repo that will create a standalone WebView where the issue is present. Could you suggest a fix? I would really like to support these users and with this lots of syntax gets broken in these browsers. (For instance, I can’t use ElementMaker).

Thank you for your help!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
kovidgoyalcommented, May 9, 2017

Should be fixed now.

0reactions
kovidgoyalcommented, May 10, 2017

You’re welcome 😃 Finally learning javascript was one of my motivations for working on RapydScript.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object.defineProperty() - JavaScript - MDN Web Docs
This method allows a precise addition to or modification of a property on an object. Normal property addition through assignment creates ...
Read more >
Object.defineProperty does not override existing properties
Even if configurable: true was provided at definition time, a property cannot be overridden using Object.defineProperty again: var obj = {};
Read more >
Object defineProperties() in JavaScript - Scaler
Props: It represents an object having keys designating the name of the properties to be defined and values that describe those properties. Props ......
Read more >
Javascript Object.defineProperty produces a TypeError in ...
Inside a property descriptor, leave out the 'writable' property when using properties 'set' or 'get'.
Read more >
Thinking About ECMAScript 5 Parts - Cody Lindley
defineProperty , and Object.getOwnPropertyDescriptor . However, it is best to think of IE8 as an ES3 Browser. Remembering this becomes critical ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found