| Index: test/intl/collator/protected-icu-internals.js
|
| diff --git a/src/extensions/i18n/i18n-extension.h b/test/intl/collator/protected-icu-internals.js
|
| similarity index 72%
|
| copy from src/extensions/i18n/i18n-extension.h
|
| copy to test/intl/collator/protected-icu-internals.js
|
| index 050c336a67a21fd6cb32892e14215cac11971111..db695411a4ce5f8cb5955cd0750a1c15168379a5 100644
|
| --- a/src/extensions/i18n/i18n-extension.h
|
| +++ b/test/intl/collator/protected-icu-internals.js
|
| @@ -26,26 +26,25 @@
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| // limitations under the License.
|
|
|
| -#ifndef V8_EXTENSIONS_I18N_I18N_EXTENSION_H_
|
| -#define V8_EXTENSIONS_I18N_I18N_EXTENSION_H_
|
| +// Internal object we got from native code should not be writable,
|
| +// configurable or enumerable. One can still change its public properties, but
|
| +// we don't use them to do actual work.
|
|
|
| -#include "v8.h"
|
| +var collator = new Intl.Collator([]);
|
|
|
| -namespace v8_i18n {
|
| +// Direct write should fail.
|
| +collator.collator = {'zzz':'some random object'};
|
|
|
| -class Extension : public v8::Extension {
|
| - public:
|
| - Extension();
|
| +assertFalse(collator.collator.hasOwnProperty('zzz'));
|
|
|
| - virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
|
| - v8::Handle<v8::String> name);
|
| +// Try redefining the property.
|
| +var didThrow = false;
|
| +try {
|
| + Object.defineProperty(collator, 'collator', {value: undefined});
|
| +} catch(e) {
|
| + didThrow = true;
|
| +}
|
| +assertTrue(didThrow);
|
|
|
| - static void Register();
|
| -
|
| - private:
|
| - static Extension* extension_;
|
| -};
|
| -
|
| -} // namespace v8_i18n
|
| -
|
| -#endif // V8_EXTENSIONS_I18N_I18N_EXTENSION_H_
|
| +// Try deleting the property.
|
| +assertFalse(delete collator.collator);
|
|
|