Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Object.defineProperty is not a function

I'm trying to execute JS code from ABAP and I'm getting the following error:

Object.defineProperty is not a function.

My code:

Object.defineProperty(object, sProperty, vValue)

I want to redefine the funcion to be supported, any advice?

like image 712
ameni Avatar asked Feb 15 '16 20:02

ameni


1 Answers

Note that there's a nasty Chrome error bug.

This code:

Object.defineProperty({},'asd',{})()

..on Chrome throws:

Uncaught TypeError: Object.defineProperty(...) is not a function at :1:35

..but it should say that its the returned object of Object.defineProperty that is not a function.


For your case, it most probably mean that you are doing () (a function call) on the returned value of Object.defineProperty. And to fix it, the first return value of defineProperty must be a function, which means the first arg must be a function.

like image 151
Pacerier Avatar answered Oct 22 '22 13:10

Pacerier