Fwd: V8 typeof(Function(str)) is undefined

26 views
Skip to first unread message

victoria yang

unread,
Jan 13, 2022, 12:35:52 PM1/13/22
to blin...@chromium.org


Hi,
  Recently I encountered an issue in V8. 

Issue
typeof(Function(str)) is undefined

Env:
Step1: In One Isolate, I create Context A (Run Common JS bundle ) and Context B(Run Business JS Bundle), and set Same SecurityToken.

Step2:  
In ContextA  had JS code Below :

 testFunction(){
  let tmpFunc = Function("(function test(\n) {\nreturn 7;\n})\n");
  console.log(typeof tmpFunc);
}

on ContextA, run testFunction(), console result is 'function'

Step3:
In ContextB, call testFunction in ContextA
console result is 'undefined',
and run tmpFunc(), report Exception ' is not a function'


And For Object.create() 、Object.is() and so on shows OK. Only StringToFunction shows error.
Do you know Why it causes such an issue? Any Advice ?


Pls,help. 
Thank you for your time and I look forward to your reply.

K. Moon

unread,
Jan 13, 2022, 12:38:39 PM1/13/22
to victoria yang, blin...@chromium.org
I see you cross-posted this question to the v8-dev mailing list, which probably is a better venue for asking this question. Blink refers to the HTML engine in Chromium, and is not directly related to JavaScript execution.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAP96edPrJ%2Bdm0dysQzFwiE7m_4En_ZhkYC60D8%2BtBaWCGU2_kg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages