소스 검색

Add globalThis

Mihail Stoykov 4 년 전
부모
커밋
2440f896e9
2개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      builtin_global.go
  2. 1 0
      tc39_test.go

+ 1 - 0
builtin_global.go

@@ -328,6 +328,7 @@ func (r *Runtime) builtin_unescape(call FunctionCall) Value {
 
 
 func (r *Runtime) initGlobalObject() {
 func (r *Runtime) initGlobalObject() {
 	o := r.globalObject.self
 	o := r.globalObject.self
+	o._putProp("globalThis", r.globalObject, true, false, true)
 	o._putProp("NaN", _NaN, false, false, false)
 	o._putProp("NaN", _NaN, false, false, false)
 	o._putProp("undefined", _undefined, false, false, false)
 	o._putProp("undefined", _undefined, false, false, false)
 	o._putProp("Infinity", _positiveInf, false, false, false)
 	o._putProp("Infinity", _positiveInf, false, false, false)

+ 1 - 0
tc39_test.go

@@ -364,6 +364,7 @@ var (
 		"sec-strict-mode-of-ecmascript",
 		"sec-strict-mode-of-ecmascript",
 		"sec-let-and-const-declarations*",
 		"sec-let-and-const-declarations*",
 		"sec-arguments-exotic-objects-defineownproperty-p-desc",
 		"sec-arguments-exotic-objects-defineownproperty-p-desc",
+		"sec-other-properties-of-the-global-object-globalthis",
 	}
 	}
 )
 )