============================================================================= OPTIMIZED HELPER FUNCTIONS ============================================================================= getValidObjectValue extracts and validates object value from JavaScript instance
(ctx *Context, this *Value)
| 298 | |
| 299 | // getValidObjectValue extracts and validates object value from JavaScript instance |
| 300 | func getValidObjectValue(ctx *Context, this *Value) (reflect.Value, error) { |
| 301 | obj, err := this.GetGoObject() |
| 302 | if err != nil { |
| 303 | return reflect.Value{}, fmt.Errorf("failed to get instance data: %w", err) |
| 304 | } |
| 305 | |
| 306 | objValue := reflect.ValueOf(obj) |
| 307 | if objValue.Kind() == reflect.Ptr { |
| 308 | objValue = objValue.Elem() |
| 309 | } |
| 310 | |
| 311 | return objValue, nil |
| 312 | } |
| 313 | |
| 314 | // shouldSkipMethod determines if a method should be skipped during binding |
| 315 | func shouldSkipMethod(method reflect.Method, opts *ReflectOptions) bool { |
no test coverage detected