phpv8/v8js

PROHIBITS_OVERWRITING removed from V8 and causing V8Js compile error.

Closed this issue · 1 comments

Hey
Getting an issue when compiling V8Js (latest php8 branch) against V8 12.0.267.14

/build/v8js/v8js_variables.cc: In function 'void v8js_register_accessors(std::vector<v8js_accessor_ctx*>*, v8::Local<v8::FunctionTemplate>, zval*, v8::Isolate*)':
/build/v8js/v8js_variables.cc:83:185: error: 'PROHIBITS_OVERWRITING' is not a member of 'v8'
   83 | STR_LEN(property_name))), v8js_fetch_php_variable, NULL, v8::External::New(isolate, ctx), v8::PROHIBITS_OVERWRITING, v8::ReadOnly);

Is this just as simple as changing v8::PROHIBITS_OVERWRITING to v8::DEFAULT? It's what we've done for the time being, and it allows everything to compile successfully and all the tests pass - but don't want to be taking any gambles here that it could cause unforeseen issues.

It's been a little while since I've dug into the V8Js code too, so I'd be keen to know what this is for so I can test a specific use case.

Cheers

php-v8js exports values via proxy objects that have "accessor functions" defined. So if you read a value, php-v8js native code is invoked instead of plainly reading the value from an underlying object.

The PROHIBITS_OVERWRITING flag made sure, that JS-code cannot replace this accessor function. IMHO that's not a big deal, if JS code wants to remove it, it just can do so. It'll just "hurt" itself, since it won't be able to read/write the values any longer...

So yes, IMHO replacing it by v8::DEFAULT is just fine.