Validation workaround `global-self`: `self` is not defined in Babylon Native

Đang mở
#2,015 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@bkaradzic-microsoft đang làm issue này rồi.

Từ ngày 3/11/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Affected tests (1)

  • GUI Input Test

What the workaround does

Defines self before the test. Babylon.js GUI advancedDynamicTexture.ts (~line 1178) calls self.addEventListener for clipboard events; BN doesn't define self. Introduced in #1959.

Recommended fix

Define self (= globalThis) in the BN/JsRuntimeHost Window polyfill. Check side effects in thinNativeEngine.pure.ts:82 (defines a _native getter on self if missing) and tools.internals.ts:29. Alternatively change Babylon.js to use window/globalThis with a guard.


Workaround implementations live in Apps/Playground/Scripts/validation_native.js (WORKAROUNDS map); tests opt in via the workarounds array in Apps/Playground/Scripts/config.json. See Documentation/AddingNewValidationTests.md.

Ngôn ngữ chính
C++
Star
931
Fork
169
Merge trung bình
2 ngày 17 giờ
Pull request đã merge (30 ngày)
66

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của BabylonJS/BabylonNative

Tất cả issue của BabylonJS/BabylonNative

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.