Changeset 167963 in webkit for trunk/Source/JavaScriptCore/jsc.cpp
- Timestamp:
- Apr 29, 2014, 3:21:04 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jsc.cpp
r167612 r167963 242 242 static bool fillBufferWithContentsOfFile(const String& fileName, Vector<char>& buffer); 243 243 244 static EncodedJSValue JSC_HOST_CALL functionCreateProxy(ExecState*); 245 244 246 static EncodedJSValue JSC_HOST_CALL functionSetElementRoot(ExecState*); 245 247 static EncodedJSValue JSC_HOST_CALL functionCreateRoot(ExecState*); … … 414 416 addFunction(vm, "effectful42", functionEffectful42, 0); 415 417 addFunction(vm, "makeMasquerader", functionMakeMasquerader, 0); 418 419 addFunction(vm, "createProxy", functionCreateProxy, 1); 416 420 417 421 JSArray* array = constructEmptyArray(globalExec(), 0); … … 570 574 element->setRoot(root); 571 575 return JSValue::encode(jsUndefined()); 576 } 577 578 EncodedJSValue JSC_HOST_CALL functionCreateProxy(ExecState* exec) 579 { 580 JSLockHolder lock(exec); 581 JSValue target = exec->argument(0); 582 if (!target.isObject()) 583 return JSValue::encode(jsUndefined()); 584 JSObject* jsTarget = asObject(target.asCell()); 585 Structure* structure = JSProxy::createStructure(exec->vm(), exec->lexicalGlobalObject(), jsTarget->prototype()); 586 JSProxy* proxy = JSProxy::create(exec->vm(), structure, jsTarget); 587 return JSValue::encode(proxy); 572 588 } 573 589
Note:
See TracChangeset
for help on using the changeset viewer.